:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #e2e4e9;
  --line: #edeef2;
  --text: #1c2230;
  --text-muted: #67707f;
  --primary: #1f6feb;
  --primary-ink: #ffffff;
  --danger: #c23b3b;
  --danger-bg: #fdecec;
  --ok: #1f9d55;
  --active-row: #e3edff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 25, 40, 0.08), 0 1px 2px rgba(20, 25, 40, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden attribute must always win, even over a .class that sets display */

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

.app-loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: var(--text-muted);
}

/* ---------- primitives ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.muted { color: var(--text-muted); }
.small { font-size: 13px; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.9em;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 8px;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}
.btn-primary:hover { background: #1a5fd0; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.banner {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.banner-error { background: var(--danger-bg); color: var(--danger); }

/* ---------- auth screens ---------- */
.auth-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}
.auth-screen-space {
  background: radial-gradient(ellipse at 50% 40%, #131c33 0%, #0a0f1e 55%, #05070f 100%);
}
.spider-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-card h1 { margin: 0; font-size: 22px; }
.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.auth-card input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}
.auth-card input:focus {
  outline: 2px solid rgba(31, 111, 235, 0.35);
  border-color: var(--primary);
}

/* ---------- app frame ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-brand { font-weight: 700; letter-spacing: -0.01em; }
.topbar-nav { display: flex; gap: 4px; flex: 1; }
.navlink {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 550;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink[aria-current="page"] { background: var(--surface-2); color: var(--primary); }

.topbar-user { display: flex; align-items: center; gap: 10px; }
.who { font-weight: 550; font-size: 14px; }
.role-chip {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.role-chip.role-superadmin { color: #8a5a00; border-color: #f0d9b0; background: #fdf4e3; }
.role-chip.role-admin { color: var(--primary); border-color: #cfe0fb; background: #eef4fe; }

.page { padding: 24px; max-width: 1200px; margin: 0 auto; }
body.wide-view .page { max-width: none; padding: 16px 20px; }

/* Rota view goes full-bleed: fills the viewport below the top bar. */
body.rota-view { overflow: hidden; }
body.rota-view #app { display: flex; flex-direction: column; height: 100vh; }
body.rota-view .topbar { flex: none; }
body.rota-view .page { flex: 1; min-height: 0; max-width: none; margin: 0; padding: 0; display: flex; }
body.rota-view .rota {
  flex: 1;
  min-height: 0;
  min-width: 0;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  transition: grid-template-columns 0.26s ease;
}
body.rota-view .rota.no-anim { transition: none; }
body.rota-view .rota.side-collapsed { grid-template-columns: 0px minmax(0, 1fr); }
@media (prefers-reduced-motion: reduce) { body.rota-view .rota { transition: none; } }

body.rota-view .rota-side {
  position: static;
  height: auto;
  width: auto;
  min-width: 0;
  padding: 0;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
}
body.rota-view .rota-side-inner { width: 248px; padding: 12px; box-sizing: border-box; }
body.rota-view .rota.side-collapsed .rota-side { border-right-width: 0; }
body.rota-view .rota-main {
  border: none;
  border-radius: 0;
  box-shadow: none;
  height: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
body.rota-view .rota-scroll { flex: 1; min-height: 0; max-height: none; }

/* ---------- toast ---------- */
#toast-host {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.toast-in { opacity: 1; transform: none; }
.toast-error { background: var(--danger); }
.toast-ok { background: var(--ok); }

@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .topbar-nav { order: 3; width: 100%; overflow-x: auto; }
  .page { padding: 16px; }
}

/* ===================== rota grid ===================== */
.rota { display: flex; gap: 16px; align-items: flex-start; }

.rota-side {
  flex: none;
  width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  position: sticky;
  top: 72px;
}
.rota-side-h {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.rota-side-list { display: flex; flex-direction: column; gap: 5px; }
.emp-chip {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--surface);
  cursor: grab;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.emp-chip:hover { background: var(--surface-2); }
.emp-name { font-weight: 600; font-size: 13px; }
.emp-pos { font-size: 11px; color: var(--text-muted); }
.emp-tot { font-size: 10px; color: var(--primary); font-weight: 600; margin-top: 1px; }
.emp-tot:empty { display: none; }
.emp-off { font-size: 10px; color: #b06a1a; font-weight: 600; margin-top: 1px; }
.side-count {
  font-size: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 6px;
  color: var(--text-muted);
  font-weight: 700;
}
.rota-side-h { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.rota-side-h:first-child { margin-top: 0; }

.dept-h {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 6px;
  padding-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}
.dept-group:first-child .dept-h { margin-top: 0; }
/* Smooth expand/collapse: animate grid-template-rows (0fr <-> 1fr) instead of
   toggling display, since height can't be transitioned to/from "auto". */
.dept-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}
.dept-collapse.is-expanded { grid-template-rows: 1fr; }
.dept-collapse > .rota-side-list { overflow: hidden; min-height: 0; }
.dept-vis-cb { flex: none; width: 13px; height: 13px; margin: 0; cursor: pointer; accent-color: var(--primary); }
.dept-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.dept-caret { flex: none; width: 9px; font-size: 10px; color: var(--text-muted); }
.emp-chip-head { display: flex; align-items: center; gap: 6px; }
.emp-vis-cb { flex: none; width: 13px; height: 13px; margin: 0; cursor: pointer; accent-color: var(--primary); }
.emp-chip.cat-short { border-color: #f0d9b0; background: #fffaf1; cursor: grab; }
.emp-chip.cat-long { opacity: 0.6; background: var(--surface-2); cursor: not-allowed; }
.rg-day.is-nodrop { background-color: rgba(194, 59, 59, 0.08); box-shadow: inset 0 0 0 2px var(--danger); cursor: not-allowed; }
.rota-side-tool {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.slot-chip {
  background: linear-gradient(180deg, rgba(15, 39, 92, 0.92), rgba(20, 52, 120, 0.82));
  border: 1px solid rgba(10, 30, 80, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px rgba(15, 39, 92, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: grab;
}
.slot-chip .emp-name { color: #fff; }
.slot-chip .emp-pos { color: rgba(255, 255, 255, 0.7); }
.slot-chip.is-dragging { opacity: 0.4; }
/* REC (recording) — glassy dark red. EXT (external coverage) — glassy dark green. */
.slot-chip-rec {
  background: linear-gradient(180deg, rgba(92, 20, 20, 0.92), rgba(130, 26, 26, 0.82));
  border-color: rgba(64, 10, 10, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px rgba(92, 20, 20, 0.35);
}
.slot-chip-ext {
  background: linear-gradient(180deg, rgba(15, 74, 40, 0.92), rgba(20, 110, 58, 0.82));
  border-color: rgba(8, 48, 26, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px rgba(15, 74, 40, 0.35);
}

/* ---- Mark Live Qatar / UAE: glassy LIGHT rose and green ----
   Sidebar chips (dragged onto the time bar), the tinted band across each day,
   and the handle on the time bar itself where a mark is resized. */
.mark-chip {
  cursor: grab;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mark-chip.is-dragging { opacity: 0.4; }
.mark-chip-qatar {
  background: linear-gradient(180deg, rgba(255, 234, 240, 0.95), rgba(251, 208, 221, 0.78));
  border: 1px solid rgba(228, 156, 180, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 6px rgba(228, 156, 180, 0.3);
}
.mark-chip-uae {
  background: linear-gradient(180deg, rgba(230, 241, 255, 0.95), rgba(190, 217, 252, 0.78));
  border: 1px solid rgba(125, 165, 228, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 6px rgba(125, 165, 228, 0.3);
}
.mark-chip-qatar .emp-name { color: #7a1f3a; }
.mark-chip-qatar .emp-pos { color: rgba(122, 31, 58, 0.7); }
.mark-chip-uae .emp-name { color: #1e4a8f; }
.mark-chip-uae .emp-pos { color: rgba(30, 74, 143, 0.7); }

.rg-mark {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 0;
  pointer-events: none; /* purely a background — shifts and slots stay fully clickable */
}
.rg-mark.mark-qatar {
  background: linear-gradient(180deg, rgba(255, 230, 238, 0.5), rgba(251, 208, 221, 0.34));
  border-top: 1px solid rgba(228, 156, 180, 0.7);
  border-bottom: 1px solid rgba(228, 156, 180, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.rg-mark.mark-uae {
  background: linear-gradient(180deg, rgba(224, 237, 255, 0.5), rgba(190, 217, 252, 0.34));
  border-top: 1px solid rgba(125, 165, 228, 0.7);
  border-bottom: 1px solid rgba(125, 165, 228, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.rg-axis.is-mark-drop { background: rgba(31, 111, 235, 0.07); box-shadow: inset 0 0 0 2px var(--primary); }
.rg-mark-handle {
  position: absolute;
  width: 13px;
  border-radius: 4px;
  overflow: hidden;
  z-index: 2;
}
.rg-mark-handle.mark-qatar {
  right: 17px;
  background: linear-gradient(90deg, rgba(255, 234, 240, 0.98), rgba(251, 208, 221, 0.85));
  border: 1px solid rgba(228, 156, 180, 0.9);
}
.rg-mark-handle.mark-uae {
  right: 2px;
  background: linear-gradient(90deg, rgba(230, 241, 255, 0.98), rgba(190, 217, 252, 0.85));
  border: 1px solid rgba(125, 165, 228, 0.9);
}
.rg-mark-handle.is-grabbing { box-shadow: 0 4px 12px rgba(20, 25, 40, 0.3); }
.rg-mark-label {
  position: absolute;
  inset: 8px 0;
  writing-mode: vertical-rl;
  text-align: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  line-height: 11px;
  pointer-events: none;
}
.rg-mark-handle.mark-qatar .rg-mark-label { color: #7a1f3a; }
.rg-mark-handle.mark-uae .rg-mark-label { color: #1e4a8f; }
.rg-mark-grip {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  cursor: ns-resize;
  z-index: 3;
  touch-action: none;
}
.rg-mark-grip-t { top: 0; }
.rg-mark-grip-b { bottom: 0; }
.rg-mark-handle.is-editable:hover .rg-mark-grip { background: rgba(20, 25, 40, 0.22); }
.rg-mark-x {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  display: none;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.85);
  font-size: 10px;
  line-height: 12px;
  cursor: pointer;
  color: var(--danger);
  z-index: 3;
}
.rg-mark-handle.is-editable:hover .rg-mark-x { display: block; }

/* ---- Admin Console tabs ---- */
.console-tabs { flex-wrap: wrap; row-gap: 4px; }
.console-tabs .tab-btn { padding: 9px 14px; display: inline-flex; align-items: center; }
.tab-ico { margin-right: 7px; font-size: 14px; line-height: 1; }
/* The tab already names the page, so hide a page's own title-only header. */
.console-pane .plan-bar:has(> strong:only-child) { display: none; }

/* ---- on-air segments inside a shift bar ---- */
.rg-shift.is-slot-target { outline: 2px dashed rgba(15, 39, 92, 0.9); outline-offset: -2px; }
.rg-seg {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(15, 39, 92, 0.94), rgba(20, 52, 120, 0.86));
  border: 1px solid rgba(8, 24, 66, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 10px;
  line-height: 1.2;
  padding: 10px 4px 1px;
  overflow: hidden;
  cursor: grab;
  z-index: 5;
}
.rg-seg.is-grabbing { z-index: 30; box-shadow: 0 6px 16px rgba(8, 24, 66, 0.5); cursor: grabbing; }
.rg-seg.is-sliding { transition: top 120ms ease-out; }
/* REC (recording) — glassy dark red. EXT (external coverage) — glassy dark green. */
.rg-seg.type-rec {
  background: linear-gradient(180deg, rgba(92, 20, 20, 0.94), rgba(130, 26, 26, 0.86));
  border-color: rgba(64, 10, 10, 0.9);
}
.rg-seg.type-ext {
  background: linear-gradient(180deg, rgba(15, 74, 40, 0.94), rgba(20, 110, 58, 0.86));
  border-color: rgba(8, 48, 26, 0.9);
}
.rg-seg-type { font-weight: 700; letter-spacing: 0.04em; opacity: 0.9; margin-right: 3px; }
.rg-seg.has-note::before {
  content: "";
  position: absolute;
  top: 2px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 0 1px rgba(8, 24, 66, 0.6);
}
.rg-seg-time { font-weight: 700; white-space: nowrap; }
.rg-seg-label { display: block; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-seg-grip {
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  cursor: ns-resize;
  z-index: 2;
}
.rg-seg-grip-t { top: -1px; }
.rg-seg-grip-b { bottom: -1px; }
.rg-seg-grip::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.6);
  opacity: 0;
}
.rg-seg:hover .rg-seg-grip::after { opacity: 1; }
.rg-seg-grip-t::after { top: 1px; }
.rg-seg-grip-b::after { bottom: 1px; }
.rg-seg-x {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  text-align: center;
  border: none;
  background: none;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 10px;
  cursor: pointer;
  padding: 1px 0;
  opacity: 0;
  z-index: 3;
}
.rg-seg:hover .rg-seg-x { opacity: 0.85; }
.rg-seg-x:hover { opacity: 1; }

.rota-main {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rota-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.rota-week { font-weight: 650; margin-left: 4px; }
.rota-mode {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}
.topbar-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  font-size: 15px;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
}
.topbar-toggle:hover { background: var(--surface-2); }

.rota-scroll { overflow: auto; max-height: calc(100vh - 190px); }

.rota-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 80px); /* overridden inline per week */
  column-gap: 8px;
  background: var(--surface-2);
  position: relative;
  width: max-content;
}
.rota-grid.is-loading { opacity: 0.5; }

.rg-corner { position: sticky; top: 0; left: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); }
.rg-dayhead {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 6px 2px;
  font-weight: 650;
  font-size: 13px;
}
.rg-dayhead small { display: block; color: var(--text-muted); font-weight: 500; font-size: 11px; }
.rg-day-event {
  display: inline-block;
  max-width: 100%;
  margin-top: 3px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #4a2f7a;
  background: linear-gradient(180deg, rgba(230, 220, 250, 0.95), rgba(206, 188, 240, 0.88));
  border: 1px solid rgba(122, 92, 178, 0.4);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rg-day-event:hover { filter: brightness(1.05); }
.rg-add {
  position: absolute;
  top: 4px;
  right: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  border-radius: 6px;
  width: 20px;
  height: 20px;
  line-height: 1;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.rg-add:hover { background: var(--primary); color: #fff; }
.rg-dayhead.is-today { color: var(--primary); }
.rg-dayhead.is-today small { color: var(--primary); }

.rg-axis {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.rg-hour {
  height: 52px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.rg-hour span {
  position: absolute;
  top: 3px;
  right: 36px;
  font-size: 10px;
  color: var(--text-muted);
}

.rg-day {
  position: relative;
  z-index: 0; /* own stacking context — a dragged/resized shift's raised
                 z-index (.is-grabbing, up to 30) must never out-rank the
                 sticky axis/headers, which live in the parent grid's context */
  height: var(--grid-height);
  background-color: var(--surface);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 51px,
    var(--line) 51px,
    var(--line) 52px
  );
}

.rg-shift {
  position: absolute;
  border: 1.5px solid var(--shift-border, #8fb6f6);
  background: var(--shift, #dbe8ff);
  border-radius: 7px;
  padding: 2px 4px;
  font-size: 10px;
  overflow: hidden;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
}
.rg-shift.is-open {
  background: linear-gradient(#dbe8ff 55%, rgba(219, 232, 255, 0.15));
  border-style: dashed;
}
/* Technical/production departments (Director, Studio, Audio, Lighting,
   Drivers, MCR, TX, Library, Graphic, Engineers) — glassy light yellow bar. */
.rg-shift.dept-tech {
  background: linear-gradient(180deg, rgba(255, 249, 219, 0.95), rgba(255, 237, 163, 0.88));
  border-color: rgba(196, 162, 42, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.rg-shift.dept-tech.is-open {
  background: linear-gradient(rgba(255, 249, 219, 0.95) 55%, rgba(255, 249, 219, 0.15));
  border-style: dashed;
}
/* The after-midnight part of an overnight shift, shown on the next day: same colour,
   lighter and dashed so it reads as a continuation, not a separate shift. */
.rg-shift.rg-cont {
  border-style: dashed;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0 6px, transparent 6px 12px);
  opacity: 0.92;
}
.rg-shift-name {
  font-weight: 700;
  color: #1c2230;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rg-shift-mid { flex: 1; min-height: 0; overflow: hidden; }
.rg-shift-time { color: #3b5b8c; white-space: nowrap; }
.rg-shift-prog { color: #3b5b8c; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-shift-foot {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  color: #3b5b8c;
  border-top: 1px solid rgba(59, 91, 140, 0.25);
  padding-top: 1px;
  margin-top: 2px;
}
.rg-shift.is-compact .rg-shift-mid { display: none; }
.rg-shift.is-compact .rg-shift-foot { border-top: none; margin-top: 0; }
.rg-shift.is-compact { font-size: 10px; }
.rg-badge {
  display: inline-block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #fff;
  border: 1px solid var(--shift-border, #8fb6f6);
  border-radius: 999px;
  padding: 0 5px;
  color: #3b5b8c;
}
/* Bureau tint on just the little badge, not the whole bar — glassy red/green. */
.rg-badge.loc-doha {
  background: linear-gradient(180deg, rgba(253, 223, 223, 0.95), rgba(247, 190, 190, 0.88));
  border-color: rgba(196, 76, 76, 0.55);
  color: #8a2e2e;
}
.rg-badge.loc-dubai {
  background: linear-gradient(180deg, rgba(214, 246, 222, 0.95), rgba(179, 232, 195, 0.88));
  border-color: rgba(59, 158, 94, 0.55);
  color: #1f6b3d;
}

.emp-chip.is-dragging { opacity: 0.4; }
.rg-day.is-drop { background-color: rgba(31, 111, 235, 0.08); box-shadow: inset 0 0 0 2px var(--primary); }
.rg-shift.is-editable { cursor: default; }
.rg-shift.is-editable:hover { filter: brightness(0.97); box-shadow: 0 2px 8px rgba(20, 25, 40, 0.18); }
.rg-shift.is-grabbing { z-index: 20; box-shadow: 0 6px 20px rgba(20, 25, 40, 0.3); cursor: grabbing; user-select: none; }
.rg-shift.is-grabbing .rg-shift-mid { display: block; }
.rg-shift.is-grabbing .rg-shift-time { font-weight: 700; color: var(--text); }
.rg-shift.is-grabbing .rg-shift-foot span:last-child { font-weight: 700; color: var(--text); }

.rg-move {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 11px;
  color: #3b5b8c;
  cursor: grab;
  line-height: 1;
  padding: 2px;
  z-index: 3;
}
.rg-grip {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  cursor: ns-resize;
  z-index: 3;
}
.rg-grip-t { top: -2px; }
.rg-grip-b { bottom: -2px; }
.rg-grip::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--shift-border, #8fb6f6);
  opacity: 0;
}
.rg-shift.is-editable:hover .rg-grip::after { opacity: 1; }
.rg-grip-t::after { top: 1px; }
.rg-grip-b::after { bottom: 1px; }

.rg-drag-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--text);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 25;
}
.rg-drag-label.is-on { opacity: 1; }

@media (max-width: 720px) {
  .rota { flex-direction: column; }
  .rota-side { width: 100%; position: static; }
  .rota-side-list { flex-direction: row; flex-wrap: wrap; }
  .emp-chip { flex: 1 1 45%; }
}

/* ===================== modal + forms ===================== */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 32, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 380px;
  max-width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 15px; }
.modal-x { border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 16px; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.modal-foot .spacer { flex: 1; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.stack input, .stack select, .stack textarea {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}
.stack textarea { resize: vertical; }
.stack input:focus, .stack select:focus, .stack textarea:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.calfield-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}
.calfield-btn:hover { background: var(--surface-2); }
.calfield-btn:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }

/* Month-grid calendar picker (Daily Plan → 📅 jump-to-date) */
.calpick { display: flex; flex-direction: column; gap: 10px; }
.calpick-head { display: flex; align-items: center; justify-content: space-between; }
.calpick-title { font-weight: 650; font-size: 15px; }
.calpick-nav {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  width: 30px;
  height: 30px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}
.calpick-nav:hover { background: var(--surface-2); }
.calpick-dow, .calpick-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.calpick-dow span { font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 4px 0; }
.calpick-day {
  border: none;
  background: none;
  border-radius: 999px;
  aspect-ratio: 1;
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.calpick-day:hover { background: var(--surface-2); }
.calpick-day.is-muted { color: var(--text-muted); opacity: 0.55; }
.calpick-day.is-today { background: var(--active-row); font-weight: 700; }
.calpick-day.is-selected { background: var(--primary); color: var(--primary-ink); font-weight: 700; }

/* Guest picker (Daily Plan → Assign. Desk double-click) */
.guestpick { display: flex; flex-direction: column; gap: 10px; }
.guestpick-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.guestpick-field input {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}
.guestpick-field input:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }
.guestpick-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.guestpick-group {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.guestpick-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 0.7fr);
  align-items: center;
  column-gap: 12px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.guestpick-item:hover { background: var(--surface); }
.guestpick-item input { width: 16px; height: 16px; flex: none; }
.guestpick-item .gp-tel, .guestpick-item .gp-mail, .guestpick-item .gp-tr, .guestpick-item .gp-booth { font-size: 12px; overflow-wrap: anywhere; }
.guestpick-item a { color: var(--primary); text-decoration: none; }
.guestpick-item a:hover { text-decoration: underline; }
.guestpick-cols {
  display: grid;
  grid-template-columns: 18px minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 0.8fr) minmax(0, 0.7fr);
  column-gap: 12px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.guestpick-group { top: 26px; }
@media (max-width: 700px) {
  .guestpick-cols { display: none; }
  .guestpick-item { grid-template-columns: 18px minmax(0, 1fr); row-gap: 2px; }
  .guestpick-item .gp-tel, .guestpick-item .gp-mail, .guestpick-item .gp-tr, .guestpick-item .gp-booth { grid-column: 2; }
}
.guestpick-empty { padding: 10px; }

.timefield, .datefield { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.timefield select, .datefield select {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 6px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}
.timefield-sep { font-weight: 700; color: var(--text-muted); }
.check-inline { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; color: var(--text) !important; }
.check-inline input { width: auto; }

.days-field { border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin: 0; }
.days-field legend { font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 0 4px; }
.days-row { display: flex; gap: 4px; }
.day-toggle { flex: 1; }
.day-toggle input { position: absolute; opacity: 0; }
.day-toggle span {
  display: block;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.day-toggle input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.day-toggle input:focus-visible + span { outline: 2px solid rgba(31, 111, 235, 0.4); }

.btn-danger { color: var(--danger); border-color: var(--danger); background: var(--surface); }
.btn-danger:hover { background: var(--danger-bg); }

/* ===================== tables / leave page ===================== */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { margin: 0; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.tbl tbody tr:hover { background: var(--surface-2); }
.emp-row-offboarded td {
  background: linear-gradient(180deg, rgba(253, 223, 223, 0.95), rgba(247, 190, 190, 0.88));
}
.emp-row-offboarded:hover td {
  background: linear-gradient(180deg, rgba(249, 210, 210, 0.95), rgba(240, 175, 175, 0.88));
}
.pill {
  display: inline-block;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
}

/* ===================== Daily Plan spreadsheet ===================== */
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.plan-bar > strong { font-size: 16px; }
.plan-daybtn { min-width: 150px; font-weight: 650; }
.plan-daybtn.is-current { border-color: var(--primary); color: var(--primary); }
.plan-icon-btn { font-size: 15px; line-height: 1; padding: 6px 9px; }
.plan-readonly-pill { color: var(--text-muted); font-weight: 600; }
.plan-status { font-size: 12px; }
.plan-status.is-ok { color: var(--ok); }
.plan-status.is-err { color: var(--danger); }

.plan-scroll, .grid-scroll {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  max-height: calc(100vh - 220px);
}
.grid-wrap { display: flex; flex-direction: column; gap: 8px; }
.grid-pager { display: flex; align-items: center; gap: 4px; }
.grid-page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.grid-page-btn:hover:not(:disabled) { background: var(--surface-2); }
.grid-page-btn:disabled { opacity: 0.4; cursor: default; }
.grid-page-btn.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 650; }
.grid-page-ellipsis { color: var(--text-muted); padding: 0 2px; }
.grid-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid-status { font-size: 12px; }
.grid-status.is-ok { color: var(--ok); }
.grid-status.is-err { color: var(--danger); }

.plan-table, .grid-table { border-collapse: collapse; font-size: 13px; width: max-content; min-width: 100%; }
.plan-table thead th, .grid-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  white-space: nowrap;
}
.grid-th { position: sticky; }
.grid-th-label { display: inline-block; }
.grid-th.is-asc .grid-th-label::after { content: " ▲"; color: var(--primary); }
.grid-th.is-desc .grid-th-label::after { content: " ▼"; color: var(--primary); }
.grid-th-menu {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
  padding: 2px 3px;
  margin-left: 3px;
  border-radius: 4px;
}
.grid-th-menu:hover { background: var(--border); color: var(--text); }
.grid-th.is-filtered .grid-th-menu { color: var(--primary); background: #eef4fe; }
.grid-th.is-filtered .grid-th-menu::after { content: " ⧩"; }

/* Grid free-text search toolbar */
.grid-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.grid-search-all {
  width: 320px;
  max-width: 60vw;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
}
.grid-search-all:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }
.grid-count { white-space: nowrap; }

/* Cell autocomplete dropdown (column.suggest) */
.grid-suggest {
  position: fixed;
  z-index: 320;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  padding: 4px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}
.grid-suggest.is-inline { position: static; z-index: auto; box-shadow: none; border-color: var(--primary); margin: -4px 0 2px; }
.grid-suggest-opt {
  padding: 6px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.grid-suggest-opt:hover { background: var(--surface-2); }
.grid-suggest-opt.is-hi { background: var(--primary); color: #fff; }

.grid-menu {
  position: fixed;
  z-index: 300;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}
.grid-menu-sort { display: flex; gap: 6px; }
.grid-menu-sort button {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 5px;
  font: inherit;
  cursor: pointer;
}
.grid-menu-sort button:hover { background: var(--border); }
.grid-menu-search {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}
.grid-menu-all { font-weight: 600; padding: 2px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.grid-menu-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.grid-menu-list label { display: flex; align-items: center; gap: 6px; padding: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-menu-foot { display: flex; justify-content: flex-end; gap: 6px; padding-top: 4px; border-top: 1px solid var(--border); }

/* Active (focused) row — so a long row keeps its identity while you scroll right. */
.grid-table tbody tr.is-active-row td { background: var(--active-row); }
.grid-table tbody tr.is-active-row .grid-rownum { background: var(--active-row); font-weight: 700; color: var(--text); }

.plan-table tbody, .grid-table tbody { counter-reset: gridrow; }
.plan-table tbody tr, .grid-table tbody tr { counter-increment: gridrow; }
.plan-table td, .grid-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0;
}
.plan-rownum, .grid-rownum {
  width: 34px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  background: var(--surface-2);
  position: sticky;
  left: 0;
  z-index: 1;
}
.plan-table tbody .plan-rownum::before,
.grid-table tbody .grid-rownum::before { content: counter(gridrow); }
.plan-table td input:not([type]),
.plan-table td input[type="text"],
.grid-table td input:not([type]),
.grid-table td input[type="text"] {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  padding: 6px 8px;
  color: var(--text);
}
.plan-table td textarea,
.grid-table td textarea {
  width: 100%;
  display: block;
  border: none;
  background: transparent;
  font: inherit;
  padding: 6px 8px;
  color: var(--text);
  resize: none;
  line-height: 1.35;
}
.plan-table td input:focus, .grid-table td input:focus,
.plan-table td textarea:focus, .grid-table td textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: #fffef0;
}
.grid-auto { background: var(--surface-2); }
.grid-auto input { color: var(--text-muted); cursor: default; }
.plan-check, .grid-check { text-align: center; }
.plan-check input, .grid-check input { width: 16px; height: 16px; }
.grid-table.is-compact { min-width: 0; width: max-content; }
.plan-del, .grid-del { width: 30px; text-align: center; }
.plan-x, .grid-x {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
}
.plan-x:hover, .grid-x:hover { color: var(--danger); }


/* ===================== Employees & logins ===================== */
.emp-head-tools { display: flex; align-items: center; gap: 8px; }
.emp-search {
  width: 260px;
  max-width: 45vw;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
}
.emp-search:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }
.tbl-scroll { overflow-x: auto; }
.tbl-actions { white-space: nowrap; text-align: right; }
.tbl-actions .btn { margin-left: 6px; }
.emp-out-cell { text-align: center; }
.emp-out-cb { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.pill-ok { color: #1f7a3d; border-color: #bfe3cb; background: #eef8f1; }
.pill-warn { color: #8a5a00; border-color: #f0d9b0; background: #fdf4e3; }
.pill-danger { color: var(--danger); border-color: #f3c9c9; background: var(--danger-bg); }

/* ===================== Activity log ===================== */
.al-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.al-toolbar .input { width: auto; }
#al-search { min-width: 220px; flex: 1; }
.al-date-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.al-sortable { cursor: pointer; user-select: none; }
.al-sortable:hover { color: var(--text); }
.al-row { cursor: pointer; }
.al-diff { margin-top: 6px; }
.al-diff th, .al-diff td { font-size: 12.5px; }
.al-diff td:first-child { font-weight: 600; white-space: nowrap; }

/* ===================== Print: Daily Plan ===================== */
.print-area { display: none; }

@media print {
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; }
  @page { size: A4 landscape; margin: 12mm; }

  /* Force browsers to actually print the background colors below — most
     strip them by default unless the page opts in. */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }

  .print-head { margin-bottom: 12px; }
  .print-title { font-size: 20px; font-weight: 700; color: #15316b; }
  .print-sub { font-size: 13px; color: #3d5590; margin-top: 2px; }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #0d2b34;
    font-family: var(--font);
  }
  .print-table th, .print-table td {
    border: 1px solid #dfe3e8;
    padding: 8px 10px;
    text-align: center;
    vertical-align: middle;
  }
  .print-table th {
    background: #15316b;
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.01em;
  }
  .print-table tbody tr:nth-child(odd) { background: #f3f4f6; }
  .print-table tbody tr:nth-child(even) { background: #ffffff; }
  .print-table tr { break-inside: avoid; }
  .print-empty { text-align: center; color: #3d5590; padding: 16px; background: #fff !important; }
  .print-foot { margin-top: 10px; font-size: 10px; color: #666; }
}

/* ===================== Guests: tabs + Add-form ===================== */
/* Folder-tab strip, left-aligned, active tab glassy dark-blue and "raised"
   above the others — same glass formula as .slot-chip. */
.tabbar {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  border-bottom: 2px solid rgba(15, 39, 92, 0.3);
}
.tab-btn {
  position: relative;
  top: 2px;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 9px 20px;
  border-radius: 10px 10px 0 0;
  font: inherit;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
}
.tab-btn:hover { top: 0; background: var(--surface); color: var(--text); }
.tab-btn.is-active {
  top: 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(18, 46, 108, 0.96), rgba(24, 60, 138, 0.88));
  border: 1px solid rgba(10, 30, 80, 0.9);
  border-bottom: 2px solid rgba(24, 60, 138, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 3px 8px rgba(15, 39, 92, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding-top: 11px;
  padding-bottom: 11px;
  margin-bottom: -2px;
}
.tab-btn.is-active:hover { filter: brightness(1.06); }

.guestform-card { max-width: 760px; }
.guestform { display: flex; flex-direction: column; gap: 12px; }
.guestform-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.guestform-label {
  flex: 0 0 170px;
  color: #fff;
  background: linear-gradient(180deg, rgba(96, 150, 245, 0.92), rgba(66, 118, 224, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-weight: 650;
  font-size: 13px;
}
.guestform-input {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}
textarea.guestform-input { resize: vertical; min-height: 60px; }
.guestform-input:focus { outline: 2px solid rgba(31, 111, 235, 0.35); outline-offset: -2px; }
.guestform-submit { align-self: flex-start; margin-top: 4px; }

.star-picker { display: flex; align-items: center; gap: 4px; padding: 0 10px; }
.star-btn { border: none; background: none; font-size: 22px; line-height: 1; color: var(--border); cursor: pointer; padding: 2px; }
.star-btn:hover { color: #e0ac3f; }
.star-btn.is-filled { color: #f5a623; }

/* Grid cell with a trailing open-link icon (e.g. Email -> mailto:) */
.grid-link-cell { display: flex; align-items: center; }
.grid-link-cell input { flex: 1; min-width: 0; }
.grid-link-btn {
  flex: none;
  width: 26px;
  height: 26px;
  margin-right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
}
.grid-link-btn:hover { background: var(--surface-2); }
.grid-link-btn.is-empty { color: var(--border); cursor: default; }

/* ===================== Dashboard ===================== */
.dash { display: flex; flex-direction: column; gap: 18px; }
.dash-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

.dash-stats { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-top: 14px; }
.dash-stat-sep { flex: none; width: 1px; background: var(--border); margin: 4px 0; }
.dash-stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 100px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.dash-stat-pill-muted { opacity: 0.75; }
.dash-stat-num { font-size: 24px; font-weight: 700; color: var(--primary); }
.dash-stat-pill-muted .dash-stat-num { color: var(--text-muted); }
.dash-stat-pill-danger { background: #fdecec; border-color: #f3c9c9; }
.dash-stat-pill-danger .dash-stat-num { color: #c0362c; }
.dash-stat-pill-danger .dash-stat-label { color: #b04a42; }
.dash-stat-of { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.dash-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.vac-summary-line { font-size: 17px; }
.vac-week-list { margin: 4px 0 0; padding-left: 22px; font-size: 17px; }
.vac-week-list li { margin-bottom: 4px; }
.vac-week-list li:last-child { margin-bottom: 0; }

.dash-charts { display: flex; gap: 20px; margin-top: 18px; flex-wrap: wrap; }
.dash-chart-box { flex: 2 1 420px; min-width: 320px; }
.dash-chart-box-small { flex: 1 1 260px; min-width: 240px; max-width: 340px; }
.dash-chart-box h3 { margin: 0 0 10px; font-size: 14px; color: var(--text-muted); font-weight: 650; }
.dash-chart-box canvas { max-height: 320px; }

.dash-topics-row { display: flex; gap: 24px; margin-top: 14px; flex-wrap: wrap; }
.dash-topics-list { flex: 1 1 260px; max-width: 340px; }
.dash-topics-list h3 { margin: 0 0 4px; font-size: 14px; color: var(--text-muted); font-weight: 650; }
.dash-topic-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-topic-btn {
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text);
}
.dash-topic-btn:hover { background: var(--active-row); border-color: var(--primary); }
.dash-topic-count { color: var(--text-muted); font-size: 12px; }

.dash-map-box { flex: 2 1 480px; min-width: 320px; }
.dash-map-box h3 { margin: 0 0 10px; font-size: 14px; color: var(--text-muted); font-weight: 650; }
.dash-map { position: relative; width: 100%; height: 420px; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; }

/* ---- Home page ------------------------------------------------------------- */
.home-hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px;
  margin-bottom: 14px;
}
.home-id { display: flex; align-items: center; gap: 14px; min-width: 240px; }
.home-photo {
  position: relative; width: 72px; height: 72px; flex: none;
  border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 26px; font-weight: 700;
}
.home-photo img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.home-photo-btn {
  position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; padding: 0;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.home-photo-btn:hover { background: var(--surface-2); }
.home-name { font-size: 18px; font-weight: 700; }
.home-link { background: none; border: 0; padding: 0; margin-top: 2px; color: var(--primary); font-size: 12px; cursor: pointer; }
.home-link:hover { text-decoration: underline; }
.home-boxes { display: flex; gap: 12px; flex-wrap: wrap; }
.home-box {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-width: 150px; padding: 10px 14px; border: 1px dashed var(--border); border-radius: 10px;
  background: var(--surface-2);
}
.home-box-title { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.home-box-num { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--text-muted); }
.home-urgent { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
@media (max-width: 900px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.home-card .card-head { margin-bottom: 8px; }

.note-add { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.note-add > input[type="text"] { flex: 1; min-width: 0; }
.note-plus { color: var(--primary); font-size: 18px; width: 18px; text-align: center; flex: none; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.note-row .note-chk { flex: none; width: 17px; height: 17px; cursor: pointer; }
.note-row .note-text {
  flex: 1; min-width: 0; border: 1px solid transparent; background: transparent;
  padding: 4px 6px; border-radius: 6px; font: inherit;
}
.note-row .note-text:hover { border-color: var(--border); }
.note-row .note-text:focus { border-color: var(--primary); background: var(--surface); outline: none; }
.note-row .note-date {
  flex: none; width: 130px; border: 1px solid transparent; background: transparent;
  padding: 3px 4px; border-radius: 6px; font: inherit; font-size: 12px; color: var(--text-muted);
}
.note-row .note-date:hover, .note-row .note-date:focus { border-color: var(--border); background: var(--surface); }
.note-row.is-overdue .note-date { color: var(--danger); font-weight: 600; }
.note-row.is-done .note-text { text-decoration: line-through; color: var(--text-muted); }
.note-x { flex: none; border: 0; background: none; color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; opacity: 0; }
.note-row:hover .note-x, .note-x:focus { opacity: 1; }
.note-x:hover { color: var(--danger); }
.note-done { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.note-done summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-muted); }

.week-list { list-style: none; margin: 0; padding: 0; }
.week-row { display: flex; gap: 12px; padding: 6px 8px; border-top: 1px solid var(--line); font-size: 13px; }
.week-row:first-child { border-top: 0; }
.week-row.is-today { background: rgba(31, 111, 235, 0.07); border-radius: 6px; }
.week-day { width: 96px; flex: none; font-weight: 600; }
.home-tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: #fff4d6; color: #7a5b00; font-size: 12px; font-weight: 600; }

.home-box { min-width: 170px; }
.home-box-num.is-late { color: var(--danger); }
.home-box-num.home-ok { color: var(--ok); font-size: 20px; }
#att-clock { font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: 0.02em; }

/* ---- Admin Console: Attendance tab ---- */
.att-settings { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; }
.att-settings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.att-settings input { width: 110px; }
.att-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.att-tools input[type="search"], .att-tools input[type="text"], .att-tools input[type="date"], .att-tools select { min-width: 160px; }
.att-late { color: var(--danger); font-weight: 600; }

.week-row { flex-wrap: wrap; align-items: flex-start; }
.week-tasks { margin-left: 0; text-align: left; font-size: 12px; color: var(--text); }
.week-row > span:nth-child(2) { min-width: 118px; }   /* the shift column keeps one width, so the slots line up right beside it */

/* Bureau tags on shift bars: Doha red / Dubai green above; the rest follow the Dashboard colours. */
.rg-badge.loc-cairo { background: linear-gradient(180deg, rgba(255,243,205,.95), rgba(250,224,150,.88)); border-color: rgba(201,162,39,.6); color: #7a5b00; }
.rg-badge.loc-lebanon { background: linear-gradient(180deg, rgba(236,228,252,.95), rgba(214,200,247,.88)); border-color: rgba(130,80,223,.5); color: #4d2a99; }

.att-check { flex-direction: row !important; align-items: center; gap: 6px !important; }
.att-check input { width: auto !important; }
.home-leave-early { background: none; border: 0; padding: 0; color: var(--text-muted); font-size: 12px; text-decoration: underline; cursor: pointer; }
.home-leave-early:hover { color: var(--danger); }
.home-owed { color: #8a5a00; background: #fff4d6; border-radius: 6px; padding: 2px 6px; margin-top: 4px; }

/* Narrow multi-line cells (Daily Plan): no bottom padding, so a third line is clipped cleanly instead of peeking out. */
.grid-table td textarea.grid-narrow { padding-bottom: 0; overflow: hidden; }

/* ---- A light glassy colour per employee (see lib/empColor.js) ---- */
.rg-shift.has-ec {
  background: linear-gradient(180deg, var(--ec-top), var(--ec-bot));
  border-color: var(--ec-bd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.rg-shift.has-ec.is-open { background: linear-gradient(var(--ec-top) 55%, var(--ec-fade)); border-style: dashed; }
/* Technical departments used to be told apart by a yellow bar; they keep a yellow edge now. */
.rg-shift.has-ec.dept-tech { box-shadow: inset 4px 0 0 rgba(224, 184, 40, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.emp-dot {
  flex: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ec-dot, transparent);
  box-shadow: inset 0 0 0 1px rgba(20, 25, 40, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* ---- Home: notifications on this device ---- */
.home-push {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: -4px 0 14px; padding: 8px 14px; border-radius: 10px; font-size: 13px;
  background: #eef4ff; border: 1px solid #d3e2fb; color: #1d4f91;
}
.home-push-on { background: #eefaf2; border-color: #cfe9d8; color: #1f6b3d; }
.home-push-denied, .home-push-ios-install { background: #fff8e6; border-color: #f1e0b0; color: #7a5b00; }
.home-push-actions { display: flex; gap: 8px; margin-left: auto; }

/* Phone tab bar: hidden everywhere except on phones (css/phone.css turns it on). */
.bottom-nav { display: none; }

/* Admin Console → Access */
.acc-scroll { overflow-x: auto; }
.acc-tbl th { white-space: nowrap; font-size: 12px; }
.acc-tbl td { vertical-align: middle; }
.acc-sel { min-width: 0; width: 100%; max-width: 100px; padding: 4px 0 4px 6px; font-size: 12.5px; }
/* Both Access tables fit the page: fixed layout, name column wide, level columns narrow and equal. */
.acc-tbl { table-layout: fixed; width: 100%; min-width: 1180px; max-width: 1400px; }
.acc-tbl th, .acc-tbl td { padding-left: 5px; padding-right: 5px; }
.acc-tbl th { white-space: normal; line-height: 1.25; letter-spacing: 0; vertical-align: bottom; }
.acc-tbl th:first-child, .acc-tbl td:first-child { width: 180px; padding-left: 10px; }
.acc-ind th:nth-last-child(-n+3), .acc-ind td:nth-last-child(-n+3) { width: 76px; }
.acc-ind td:nth-last-child(1) .btn { padding-left: 6px; padding-right: 6px; }
.acc-add { display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap; }
.acc-add select { max-width: 320px; }
.acc-scope summary { cursor: pointer; font-size: 13px; color: var(--accent, #2563eb); white-space: nowrap; }
.acc-scope-box { display: grid; gap: 4px; padding: 8px; margin-top: 4px; border: 1px solid var(--border, #d6dbe4); border-radius: 8px; background: var(--surface, #fff); max-height: 220px; overflow: auto; min-width: 190px; position: absolute; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.acc-scope { position: relative; }
.acc-scope-box label { display: flex; gap: 6px; font-size: 13px; align-items: center; }

/* Shift form — one-tap shift times */
.shift-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.preset-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.2; padding: 6px 10px; flex: 1 1 0; min-width: 112px; }
.preset-btn span { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.btn.preset-btn.is-active { background: #dbeafe; border-color: #60a5fa; box-shadow: 0 0 0 1px #60a5fa inset; }
.btn.preset-btn { justify-content: center; text-align: left; }

/* Daily Plan quick filters */
.plan-quick { display: inline-flex; gap: 4px; margin-left: 10px; }
.btn.plan-quick-btn.is-active { background: #dbeafe; border-color: #60a5fa; box-shadow: 0 0 0 1px #60a5fa inset; }
@media print { .plan-quick { display: none; } }

.guestpick-new { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Rota sidebar: main categories with a thin light-grey line between them */
.dept-cat { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border); }
.dept-cat:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.dept-cat-title { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }
.dept-cat-title + .dept-group .dept-h { margin-top: 4px; }

/* "Dubai time" labels — every time in the rota is Dubai time */
.tz-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e8f0fe; color: #1d4ed8; font-size: 12px; font-weight: 600; white-space: nowrap; margin-left: 8px; }
.rp-tz { display: block; color: #1d4ed8; font-weight: 600; }

/* Operations blocks in the Rota sidebar — thin line between blocks */
.dept-sub + .dept-sub { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.dept-sub .dept-group:first-child .dept-h { margin-top: 4px; }

/* ---- Booking ---- */
.bk-card { padding: 12px; }
.bk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.bk-bar .spacer, .bk-card .spacer { flex: 1; }
.bk-label { font-size: 15px; margin: 0 4px; }
.bk-seg { display: inline-flex; gap: 0; }
.bk-seg .btn { border-radius: 0; }
.bk-seg .btn:first-child { border-radius: 8px 0 0 8px; }
.bk-seg .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.bk-seg .btn.is-active { background: #e8f0fe; color: #1d4ed8; border-color: #bcd0fb; font-weight: 700; }
.bk-place { width: auto; padding: 4px 8px; }
.bk-invites { background: #eef4ff; border: 1px solid #cfdcfb; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; display: grid; gap: 6px; }
.bk-inv { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bk-grid { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.bk-head { display: grid; grid-template-columns: 80px repeat(var(--cols), minmax(110px, 1fr)); column-gap: 8px; background: var(--surface-2); position: sticky; top: 0; z-index: 5; }
.bk-corner { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; left: 0; z-index: 6; }
.bk-colhead { padding: 6px 2px; font-size: 13px; font-weight: 650; text-align: center; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.bk-colhead small { font-weight: 500; font-size: 11px; color: var(--text-muted); }
.bk-colhead.is-today, .bk-colhead.is-today small { color: var(--primary); }
.bk-scroll { max-height: calc(100vh - 290px); min-height: 360px; overflow-y: auto; overflow-x: auto; }
.bk-body { display: grid; grid-template-columns: 80px repeat(var(--cols), minmax(110px, 1fr)); column-gap: 8px; background: var(--surface-2); position: relative; }
.bk-hours { position: sticky; left: 0; background: var(--surface); z-index: 4; border-right: 1px solid var(--border); }
.bk-hour { font-size: 10px; color: var(--text-muted); text-align: right; padding: 3px 36px 0 0; border-bottom: 1px solid var(--line); box-sizing: border-box; }
.bk-col { --hp: 52px; position: relative; z-index: 0; background-color: var(--surface); cursor: cell;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hp, 52px) - 1px), var(--line) calc(var(--hp, 52px) - 1px), var(--line) var(--hp, 52px)); }
.bk-col.is-today { background-color: var(--surface); }
.bk-now { position: absolute; left: 0; right: 0; height: 2px; background: #dc2626; z-index: 1; pointer-events: none; }
.bk-block { position: absolute; left: 3px; right: 3px; border: 1px solid #93b4f5; background: #dbe7fe; border-radius: 6px; padding: 2px 5px; overflow: hidden; text-align: left; cursor: pointer; font-size: 12px; line-height: 1.25; display: flex; flex-direction: column; gap: 1px; }
.bk-block strong { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; }
.bk-block span, .bk-block em { color: #374151; font-style: normal; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-block.is-mine { background: #c7dbff; border-color: #3b6fd8; }
.bk-block.is-invited { border-style: dashed; }
.bk-block.is-pending { background: #fff4d6; border-color: #e0b84a; }
.bk-block:hover { filter: brightness(.97); }
.bk-when { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.bk-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; }
.bk-chip { background: #e8f0fe; color: #1d4ed8; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; }
.bk-chip button { border: 0; background: none; cursor: pointer; font-size: 15px; color: inherit; padding: 0 6px; }
.bk-h { font-size: 13px; margin: 12px 0 4px; }
.bk-guests { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bk-guests li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px solid var(--border); padding: 3px 0; }
.bk-resp { font-size: 12px; font-weight: 600; font-style: normal; }
.bk-accepted { color: #15803d; } .bk-declined { color: #b91c1c; } .bk-pending { color: #a16207; }
.bk-mine { background: #eef4ff; border-radius: 8px; padding: 6px 10px; font-weight: 600; }
.bk-notes { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.bk-empty { padding: 24px 8px; text-align: center; }
.bk-agenda { display: grid; gap: 8px; }
.bk-ag { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px; text-align: left; cursor: pointer; }
.bk-ag-time { font-weight: 700; font-size: 13px; white-space: nowrap; color: #1d4ed8; }
.bk-ag-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bk-ag-main small { color: var(--text-muted); }

/* Admin Console → Booking (places) */
.bkp-tbl { width: 100%; max-width: 900px; }
.bkp-tbl td { vertical-align: middle; }
.bkp-tbl .bkp-name { width: 100%; min-width: 160px; }
.bkp-tbl td.bkp-ord, .bkp-tbl td.bkp-act { white-space: nowrap; }
.bkp-off td { opacity: .55; }
.bkp-off td.bkp-act, .bkp-off td.bkp-on { opacity: 1; }
.bkp-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; max-width: 900px; }
.bkp-add .input[type="text"] { flex: 1; min-width: 180px; }
.bkp-note { font-size: 12px; }

/* Booking: Mark Live bands from the Rota (same colours as on the Rota) */
.bk-live { position: absolute; left: 0; right: 0; z-index: 0; pointer-events: none; box-sizing: border-box; overflow: hidden; }
.bk-live-qatar { background: linear-gradient(180deg, rgba(255, 230, 238, 0.55), rgba(251, 208, 221, 0.38)); border-top: 1px solid rgba(228, 156, 180, 0.7); border-bottom: 1px solid rgba(228, 156, 180, 0.7); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.bk-live-uae { background: linear-gradient(180deg, rgba(224, 237, 255, 0.6), rgba(190, 217, 252, 0.4)); border-top: 1px solid rgba(125, 165, 228, 0.7); border-bottom: 1px solid rgba(125, 165, 228, 0.7); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.bk-block { z-index: 1; }
.bk-livetoggle { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; cursor: pointer; }
.bk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 4px; }
.bk-dot.bk-live-qatar { border: 1px solid rgba(228, 156, 180, 0.9); background: rgba(251, 208, 221, 0.7); }
.bk-dot.bk-live-uae { border: 1px solid rgba(125, 165, 228, 0.9); background: rgba(190, 217, 252, 0.7); }
.bk-live-row { font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; margin-bottom: 6px; }
.bk-live-row.bk-live-qatar { color: #7a1f3a; }
.bk-live-row.bk-live-uae { color: #1e4a8f; }

.bk-markbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bk-markchips { display: flex; gap: 8px; }
.bk-markchips .mark-chip { padding: 5px 12px; }
.bk-hours.is-mark-drop { background: rgba(31, 111, 235, 0.07); box-shadow: inset 0 0 0 2px var(--primary); }

/* Booking form: one row per invited department, arrow opens the list of free people to tick */
.bk-depts { display: grid; gap: 6px; }
.bk-deptrow { display: flex; align-items: flex-start; gap: 6px; }
.bk-dept { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, #f7f8fa); padding: 6px 10px; }
.bk-dept summary { cursor: pointer; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.bk-dept-n { color: var(--text-muted); font-size: 12px; }
.bk-dept-box { display: grid; gap: 4px; padding: 8px 0 2px; max-height: 240px; overflow: auto; }
.bk-dept-box label { display: flex; gap: 8px; font-size: 14px; align-items: center; }
.bk-dept-tools { font-size: 12px; }
.bk-link { border: 0; background: none; padding: 0; color: var(--primary); cursor: pointer; font-size: 12px; }
.bk-dept-x { border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--text-muted); padding: 4px 6px; }
.stack .bk-dept-box label { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text); }
.stack .bk-dept-box input[type="checkbox"] { width: auto; padding: 0; margin: 0; flex: none; }
.bk-dept summary { list-style: none; }
.bk-dept summary::-webkit-details-marker { display: none; }
.bk-dept summary::before { content: "▸"; color: var(--primary); font-size: 13px; }
.bk-dept[open] summary::before { content: "▾"; }

.week-tz { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 6px; letter-spacing: 0; }

/* Rota sidebar: the slot and Mark Live chips use the same compact one-line size as on the Booking page
   (the small grey explanation line is in each chip's hover tooltip instead). */
.rota-side-tool .emp-chip { padding: 5px 12px; flex-direction: row; align-items: center; border-radius: 10px; }
.rota-side-tool .emp-chip .emp-pos { display: none; }
.rota-side-tool .emp-chip .emp-name { font-size: 14px; }

/* Booking form: external guests */
.bk-gnew { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 6px; align-items: center; }
.bk-chip small { font-size: 11px; }
@media (max-width: 560px) { .bk-gnew { grid-template-columns: 1fr; } }

.bkp-tbl .bkp-info { min-width: 220px; width: 100%; }
.bkp-tbl { max-width: 1200px; }

/* Booking form: wide, two columns (details | people), so nothing needs scrolling */
.bk-formgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px 26px; }
.bk-fcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bk-formgrid .banner { grid-column: 1 / -1; margin: 0; }
.bk-gnew { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.bk-gnew input { min-width: 0; width: 100%; box-sizing: border-box; }
.bk-formgrid .bk-chips:empty { display: none; }
@media (max-width: 800px) { .bk-formgrid { grid-template-columns: minmax(0, 1fr); } }

/* Booking: drag a booking to move it, drag its edges to resize (same feel as the Rota) */
.bk-block.is-editable { cursor: grab; touch-action: none; user-select: none; }
.bk-block.is-grabbing { cursor: grabbing; z-index: 30; box-shadow: 0 6px 18px rgba(20, 25, 40, 0.28); opacity: .95; }
.bk-grip { position: absolute; left: 0; right: 0; height: 7px; cursor: ns-resize; z-index: 2; touch-action: none; }
.bk-grip-t { top: 0; } .bk-grip-b { bottom: 0; }
.bk-block.is-editable:hover .bk-grip { background: rgba(20, 25, 40, 0.16); }

.bk-gtitle { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 4px; }
.kw-help { margin: 0 0 10px; max-width: 900px; line-height: 1.5; }


/* Booking: a colour per booking — just colours, no names */
.bk-block.has-type, .bk-block.has-type.is-mine { background: linear-gradient(180deg, var(--ec-top), var(--ec-bot)); border-color: var(--ec-bd); border-left: 4px solid var(--ec-dot); }
.bk-colorfield { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 2px 0; }
.stack .bk-swatch { display: inline-flex; flex-direction: row; position: relative; width: 28px; height: 28px; padding: 0; margin: 0; cursor: pointer; }
.stack .bk-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; pointer-events: none; }
.bk-swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ec-bd); background: linear-gradient(180deg, var(--ec-top), var(--ec-dot)); box-sizing: border-box; }
.bk-swatch-none span { border: 2px dashed var(--border); background: var(--surface); }
.bk-swatch input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }

/* Booking: copy a booking, then paste it on another day / time */
.bk-block .bk-copy { position: absolute; top: 2px; right: 4px; width: 20px; height: 20px; display: none; border-radius: 5px; background: rgba(255, 255, 255, 0.88); border: 1px solid var(--border); font-size: 13px; line-height: 18px; text-align: center; cursor: pointer; z-index: 3; color: var(--text); }
.bk-block:hover .bk-copy, .bk-block .bk-copy:focus { display: block; }
.bk-clipbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff8e6; border: 1px solid #f1e0b0; border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; font-size: 13px; }
.bk-clipact { display: inline-flex; gap: 8px; }

/* Booking: forward by e-mail — an arrow in the corner of a booking */
.bk-block .bk-fwd { position: absolute; bottom: 9px; right: 4px; width: 20px; height: 20px; display: none; border-radius: 5px; background: rgba(255, 255, 255, 0.88); border: 1px solid var(--border); font-size: 13px; line-height: 18px; text-align: center; cursor: pointer; z-index: 3; color: var(--text); }
.bk-block:hover .bk-fwd, .bk-block .bk-fwd:focus { display: block; }

/* Booking: repeat (weekly / monthly) */
.bk-repeat { display: flex; flex-direction: column; gap: 8px; }
.bk-repbox { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, #f7f8fa); }
.bk-dows { display: flex; flex-wrap: wrap; gap: 6px; }
.stack .bk-dow { flex-direction: row; position: relative; padding: 0; margin: 0; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.stack .bk-dow input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; pointer-events: none; }
.bk-dow span { display: inline-block; min-width: 40px; text-align: center; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.bk-dow input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Booking: a place that is out of service (maintenance) — hatched column */
.bk-out { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(110, 120, 140, 0.20) 0 8px, rgba(110, 120, 140, 0.07) 8px 16px); }
.bk-out span { position: sticky; top: 6px; display: block; text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding-top: 6px; }
.bkp-outcell { white-space: nowrap; }
.bkp-outcell .input { width: 135px; }
.bkp-warn { color: #b45309; font-weight: 600; white-space: normal; display: inline-block; max-width: 300px; }

/* Dashboard: "Newsroom in Glance" */
.dash-head { display: flex; flex-direction: column; gap: 10px; }
.dash-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.01em; }
.dash-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.dash-range .input { width: 150px; }
.dash-top { display: grid; grid-template-columns: 1fr; gap: 24px 40px; align-items: start; }
@media (min-width: 900px) { .dash-top { grid-template-columns: auto 1fr; } .dash-block + .dash-block { border-left: 1px solid var(--border, #e3e7ee); padding-left: 40px; } }
.dash-block h2 { margin: 0; font-size: 18px; }
.dash-block .dash-stats { margin-top: 10px; }
.dash-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c3c9d4; margin-right: 6px; vertical-align: middle; }
.dash-dot.is-on { background: #1f9d55; box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.2); }

/* Dashboard: compact cards so Staff and Studios fit in one row */
.dash-top .dash-stats { gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dash-top .dash-stat-pill { min-width: 0; padding: 7px 11px; gap: 0; border-radius: 10px; }
.dash-top .dash-stat-num { font-size: 19px; line-height: 1.2; }
.dash-top .dash-stat-of { font-size: 11px; }
.dash-top .dash-stat-label { font-size: 10px; white-space: nowrap; }
.dash-top .dash-stat-total { font-weight: 700; color: var(--text); }
@media (min-width: 900px) { .dash-top { gap: 24px 24px; } .dash-block + .dash-block { padding-left: 24px; } }

.dr-short { display: none; }

.dash-top .dash-stat-name { font-size: 12px; font-weight: 800; color: #111827; letter-spacing: 0.04em; }
.dash-range .calfield { display: inline-block; width: 130px; }
.dash-range .calfield-btn { text-align: center; font-weight: 700; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }

/* Admin Console → Performance */
.perf { max-width: 860px; }
.perf-bar { height: 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: 14px; }
.perf-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.25s; }
.perf-table { border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.perf-table th, .perf-table td { text-align: left; padding: 3px 18px 3px 0; border-bottom: 1px solid var(--border); }
.perf-table td:last-child, .perf-table th:last-child { text-align: right; padding-right: 0; }
.perf-list { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }
.banner-ok { background: #e6f4ea; color: #1b6b3a; }
.banner-warn { background: #fff4d6; color: #7a5200; }

.home-link-pw { display: block; margin-top: 6px; color: #8a2a12; font-size: 14px; font-weight: 700; }

/* Home → Find Colleague */
.fc { max-width: 900px; }
.fc-input { width: 100%; max-width: 460px; margin: 6px 0 12px; }
.fc-item { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 0.7fr); gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.fc-name { font-weight: 700; }
.fc-ext-label { color: var(--text-muted); font-size: 12px; }
.fc-ext strong { font-size: 18px; }
@media (max-width: 700px) { .fc-item { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.fc-item { grid-template-columns: 76px minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, 0.7fr); }
.fc-loc { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e8eef9; color: #1f3a6b; }
.fc-loc-doha { background: #efe7f7; color: #4b2a7a; }
@media (max-width: 700px) { .fc-item { grid-template-columns: minmax(0, 1fr); } .fc-loc-cell { margin-bottom: 2px; } }

/* Guests → History Report */
.gh-table, .gh-print { width: 100%; border-collapse: collapse; font-size: 14px; }
.gh-table th, .gh-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.gh-table th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.gh-nowrap { white-space: nowrap; }
.gh-topic { white-space: pre-line; }
.gh-hint { margin: 6px 2px; }
.gh-print td.gh-topic { white-space: pre-line; }

/* Guest History Report colours: dark-navy heads, rows alternating light sky and white (print copy + the window on screen) */
@media print {
  .print-table.gh-print th { background: #0b1f4d; }
  .print-table.gh-print tbody tr:nth-child(odd) { background: #f3f4f6; }
  .print-table.gh-print tbody tr:nth-child(even) { background: #ffffff; }
  .print-table.gh-print th, .print-table.gh-print td { border: 1px solid #dfe3e8; }
}
.gh-table th { background: #0b1f4d; color: #fff; text-transform: none; letter-spacing: 0; font-size: 13px; }
.gh-table tbody tr:nth-child(odd) { background: #f3f4f6; }
.gh-table tbody tr:nth-child(even) { background: #ffffff; }
.gh-table th, .gh-table td { border: 1px solid #dfe3e8; }

/* Add Guest picker: wider, with an editable Notes column; the columns fit the window (no sideways scroll) */
.guestpick-list { max-height: min(56vh, 560px); overflow-x: hidden; }
.guestpick-item, .guestpick-cols { grid-template-columns: 18px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 0.7fr) minmax(0, 0.5fr) minmax(0, 2.2fr); }
.gp-notes { width: 100%; box-sizing: border-box; font: inherit; font-size: 12px; line-height: 1.35; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); resize: vertical; min-height: 34px; }
.gp-notes:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }
.gp-notes-cell { min-width: 0; }
@media (max-width: 700px) { .guestpick-item { grid-template-columns: 18px minmax(0, 1fr); } .guestpick-item .gp-notes-cell { grid-column: 2; } }

/* Daily Plan: the New Media column is just a tick box — its heading wraps onto two lines to keep the column short */
.grid-th[data-key="new_media"] .grid-th-label { white-space: normal; line-height: 1.1; }

/* Home -> Today (daily report) */
.today-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.today-bar h2 { margin: 0 8px 0 0; }
.today-date .calfield { width: 150px; }
.today-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.today-table th { background: #0b1f4d; color: #fff; text-align: left; padding: 8px 10px; font-size: 13px; border: 1px solid #b9d6e8; }
.today-table td { padding: 8px 10px; vertical-align: top; border: 1px solid #b9d6e8; }
.today-table tbody tr:nth-child(odd) { background: #dff1fb; }
.today-table tbody tr:nth-child(even) { background: #ffffff; }
.today-table tbody tr.td-mine-row { background: #bfe3f7; box-shadow: inset 4px 0 0 var(--primary); font-weight: 600; }
.td-nowrap { white-space: nowrap; }
.td-topic { white-space: pre-line; }
@media (max-width: 700px) { .today-table th:nth-child(5), .today-table td:nth-child(5) { display: none; } }

/* Today report: very light gray stripes (screen + print), dark-navy heading */
.today-table tbody tr:nth-child(odd) { background: #f3f4f6; }
.today-table tbody tr:nth-child(even) { background: #ffffff; }
.today-table th, .today-table td { border-color: #dfe3e8; }
@media print {
  .print-table.gh-print.today-print tbody tr:nth-child(odd) { background: #f3f4f6; }
  .print-table.gh-print.today-print tbody tr:nth-child(even) { background: #ffffff; }
  .print-table.gh-print.today-print th, .print-table.gh-print.today-print td { border: 1px solid #dfe3e8; }
}

/* Daily Plan -> Guest list (screen + paper): red title, date box, one rounded card per item */
.plan-cards { padding: 4px 2px 24px; max-width: none; } /* the Guest list cards use the whole width of the screen */
.gl-bar { display: flex; align-items: center; gap: 10px; padding: 6px 2px 4px; }
.gl-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 10px 4px 18px; }
.gl-maintitle { margin: 0; font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; color: #a63d40; }
.gl-datebox { border: 1px solid #e3e6ea; border-radius: 12px; padding: 14px 22px 8px; min-width: 190px; text-align: center; font-size: 18px; font-weight: 600; color: #1b2340; background: #fff; }
.gl-card { border: 1.5px solid #1b2340; border-radius: 26px; padding: 20px 28px 18px; margin: 0 0 22px; background: #fff; break-inside: avoid; }
.gl-row1 { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gl-pill { display: inline-flex; align-items: center; gap: 36px; min-width: 40%; max-width: 70%; padding: 11px 30px 11px 16px; background: #1b2340; color: #fff; border-radius: 6px 36px 36px 6px; font-size: 16px; font-weight: 600; letter-spacing: 0.01em; }
.gl-pshow { text-transform: uppercase; }
.gl-nm { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; text-transform: uppercase; color: #1b2340; }
.gl-chk { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 2.5px solid #b4b8c0; border-radius: 4px; font-size: 17px; line-height: 1; font-weight: 700; color: #1b2340; }
.gl-topicbox { margin: 18px 0 16px; border: 1px solid #c9ccd1; padding: 16px 22px; min-height: 86px; line-height: 1.8; font-size: 14.5px; white-space: pre-line; }
.gl-tbl { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.gl-tbl th { text-align: start; font-weight: 400; font-size: 14.5px; color: #1b2340; padding: 8px 8px 10px; border-bottom: 1.5px solid #b4b8c0; }
.gl-tbl td { padding: 14px 8px; vertical-align: middle; border-bottom: 1.5px solid #b4b8c0; overflow-wrap: anywhere; }
.gl-tbl .gl-name { width: 26%; }
.gl-tbl .gl-title { width: 31%; }
.gl-tbl .gl-mail { width: 26%; }
.gl-tbl .gl-tel { width: 17%; }
.gl-globe { vertical-align: middle; margin-inline-end: 10px; flex: none; }
.gl-ar { color: #5b6270; font-size: 12.5px; }
.gl-tbl a { color: inherit; text-decoration: none; }
.gl-tbl a:hover { text-decoration: underline; }
.gl-empty { padding: 14px 4px; }
@media (max-width: 700px) {
  .gl-maintitle { font-size: 30px; } .gl-card { padding: 16px 14px; border-radius: 20px; } .gl-pill { min-width: 0; gap: 14px; font-size: 14px; }
  .gl-tbl, .gl-tbl tbody, .gl-tbl tr, .gl-tbl td { display: block; width: 100% !important; } .gl-tbl thead { display: none; } .gl-tbl tr { border-bottom: 1.5px solid #b4b8c0; padding: 6px 0; } .gl-tbl td { border: 0; padding: 3px 4px; }
}
@media print {
  .gl-print .gl-top { margin: 0 0 12px; }
  .gl-print .gl-maintitle { font-size: 30px; }
  .gl-print .gl-datebox { padding: 8px 16px 6px; font-size: 14px; min-width: 150px; }
  .gl-print .gl-card { padding: 12px 18px 10px; margin: 0 0 14px; border-radius: 20px; break-inside: avoid; }
  .gl-print .gl-pill { padding: 7px 22px 7px 12px; font-size: 14px; gap: 24px; }
  .gl-print .gl-nm { font-size: 13px; gap: 10px; }
  .gl-print .gl-chk { width: 20px; height: 20px; font-size: 14px; border-width: 2px; }
  .gl-print .gl-topicbox { margin: 10px 0; padding: 9px 14px; min-height: 54px; font-size: 13px; line-height: 1.7; }
  .gl-print .gl-tbl { font-size: 12px; }
  .gl-print .gl-tbl th { font-size: 12px; padding: 5px 6px 6px; }
  .gl-print .gl-tbl td { padding: 8px 6px; }
  .gl-print .gl-globe { width: 17px; height: 17px; }
  .gl-print .gl-tbl a { color: inherit; }
}

/* paper is always white (the app's gray page colour must not print behind the reports) */
@media print {
  html, body { background: #ffffff !important; }
  .print-area { background: #ffffff; }
}

/* Home: notifications switch under the Urgent leave button */
.home-urgent { gap: 10px; }
.home-notif { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.notif-row { display: flex; align-items: center; gap: 10px; }
.notif-label { font-size: 14px; }
.notif-note { max-width: 260px; margin: 0; text-align: right; }
.switch { position: relative; flex: none; width: 52px; height: 30px; padding: 0; border: 0; border-radius: 999px; background: #c9ced6; cursor: pointer; transition: background 0.2s; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.18); }
.switch .switch-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); transition: transform 0.2s; }
.switch.is-on { background: var(--primary); }
.switch.is-on .switch-knob { transform: translateX(22px); }
.switch:disabled { opacity: 0.55; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid rgba(31, 111, 235, 0.45); outline-offset: 2px; }

/* Rota: week lock switch (small) */
.switch.switch-sm { width: 40px; height: 22px; }
.switch.switch-sm .switch-knob { top: 3px; left: 3px; width: 16px; height: 16px; }
.switch.switch-sm.is-on .switch-knob { transform: translateX(18px); }
.rota-mode.is-locked { color: #8a5a00; font-weight: 600; }
.rota-mode { white-space: nowrap; }

/* Rota sidebar: collapsible main categories */
.cat-h { display: flex; align-items: center; gap: 6px; margin: 0; padding: 2px 0; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); }
.cat-toggle { flex: 1; display: flex; align-items: center; gap: 5px; min-width: 0; border: none; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; text-align: left; }
.cat-vis-cb { flex: none; width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: var(--primary); }
.dept-collapse > .cat-body { overflow: hidden; min-height: 0; }
.cat-body { padding-left: 14px; }
.cat-body .dept-group:first-child .dept-h { margin-top: 8px; }
.side-hint { margin: 0 0 10px; padding: 8px 10px; font-size: 12px; line-height: 1.4; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.cat-h { font-size: 12.5px; letter-spacing: 0.02em; }
.cat-toggle { white-space: nowrap; overflow: hidden; }
.cat-h, .cat-h .dept-caret { color: #1e3a8a; }

/* Rota: all tools live in the left sidebar (no top strip) */
.rs-nav { display: flex; align-items: center; gap: 6px; }
.rs-nav .switch { margin-left: auto; }
.rs-meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.rs-meta .tz-pill { margin-left: 0; }
.rs-meta .rota-mode { margin-left: 0; }
.rs-week { margin: 8px 0 6px; font-size: 12px; font-weight: 650; color: var(--text); }
.rota-slim { display: none; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
body.rota-view .rota.side-collapsed .rota-slim { display: flex; }

.rs-cal { margin-bottom: 10px; }
.rs-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.rs-cal-title { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 650; color: var(--text); cursor: pointer; padding: 3px 0; border-radius: 6px; }
.rs-cal-title:hover { background: var(--surface-2); }
.rs-cal-nav { width: 26px; height: 26px; border: 0; background: none; border-radius: 50%; color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer; }
.rs-cal-nav:hover { background: var(--surface-2); color: var(--text); }
.dept-collapse > .rs-cal-body { overflow: hidden; min-height: 0; }
.rs-dow, .rs-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.rs-dow span { text-align: center; font-size: 10px; font-weight: 700; color: var(--text-muted); padding: 3px 0; }
.rs-day { height: 28px; border: 0; background: none; font: inherit; font-size: 12px; color: var(--text); cursor: pointer; position: relative; padding: 0; }
.rs-day:hover:not(.is-today) { background: var(--surface-2); }
.rs-day.is-muted { color: var(--text-muted); opacity: 0.55; }
.rs-day.is-week { background: #e8f0fe; }
.rs-day.is-week-start { border-radius: 14px 0 0 14px; }
.rs-day.is-week-end { border-radius: 0 14px 14px 0; }
.rs-day.is-today { font-weight: 700; color: #fff; opacity: 1; isolation: isolate; }
.rs-day.is-today::before { content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: #d93025; z-index: -1; }

.rs-tools { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rs-btn { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px 7px 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.rs-btn::before { content: ""; position: absolute; left: 9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #7fb1ff; box-shadow: 0 0 0 0 rgba(127, 177, 255, 0); opacity: 0; transform: scale(0.4); transition: opacity 0.18s, transform 0.18s, box-shadow 0.25s; }
.rs-btn:hover { background: #f5f9ff; border-color: #cfe0fb; }
.rs-btn:hover::before { opacity: 1; transform: scale(1); box-shadow: 0 0 8px 3px rgba(127, 177, 255, 0.55); }
.rs-btn:disabled { opacity: 0.6; cursor: wait; }
.rs-ico { flex: none; width: 18px; text-align: center; }
.rs-lbl { flex: 1; min-width: 0; }
.rs-caret { flex: none; font-size: 10px; color: var(--text-muted); }
.rs-slots.rota-side-tool { padding: 0; border: 0; margin: 0; }
.dept-collapse > .rs-slots { overflow: hidden; min-height: 0; }
#slot-tool-wrap.is-expanded { margin-bottom: 12px; }

/* Week range centred above the calendar (the Dubai-time / Editing labels are gone) */
.rota-slim { position: relative; display: none; align-items: center; justify-content: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.rota-slim .rota-week { margin: 0; font-size: 14px; }
.rota-slim .rota-mode { margin-left: 0; }
.rota-slim .rota-mode:empty { display: none; }
.rota-slim .slim-nav { display: none; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); gap: 6px; }
body.rota-view .rota.side-collapsed .rota-slim { display: flex; }
body.rota-view .rota.side-collapsed .rota-slim .slim-nav { display: flex; }

/* Grid: "Then by" sorting (several levels) */
.grid-th-lvl { display: inline-block; margin-left: 3px; min-width: 14px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 9px; font-weight: 800; line-height: 14px; text-align: center; vertical-align: middle; }
.grid-menu-then { margin-top: 6px; }
.grid-menu-clearsort { display: block; width: 100%; margin-top: 6px; padding: 4px 8px; border: 0; background: none; color: var(--text-muted); font: inherit; font-size: 12px; text-align: left; cursor: pointer; border-radius: 6px; }
.grid-menu-clearsort:hover { background: var(--surface-2); color: var(--text); }
@media print { .gl-print .gl-ar { font-size: 14px; } } /* the paper copy keeps its own size */

/* Daily Plan: MCR pop-up (Didn't air + note) */
.mcr { display: flex; flex-direction: column; gap: 10px; }
.mcr-tools-old { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mcr-tools input[type="search"] { flex: 1; min-width: 220px; }
.mcr-only { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.mcr-scroll { max-height: 60vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.mcr-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.mcr-tbl th { position: sticky; top: 0; z-index: 1; background: #1b2340; color: #fff; font-weight: 600; font-size: 13px; padding: 8px 10px; text-align: start; }
.mcr-tbl td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mcr-tbl tbody tr:nth-child(even) { background: #f7fafd; }
.mcr-tbl tbody tr.is-air { background: #e8f0fe; }
.mcr-time { width: 62px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mcr-show { width: 130px; font-weight: 600; }
.mcr-topic { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.mcr-tbl th.mcr-chk, .mcr-tbl td.mcr-chk { width: 90px; text-align: center; }
.mcr-chk input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.mcr-note { width: 34%; }
.mcr-note input { width: 100%; box-sizing: border-box; }

/* Guest list card: MCR button + the simple MCR note pop-up */
.gl-right { display: flex; align-items: center; gap: 18px; }
.gl-mcr { padding: 6px 16px; border: 1.5px solid #1b2340; border-radius: 999px; background: #fff; color: #1b2340; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.gl-mcr:hover { background: #eef4fe; box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.15); }
.gl-mcr.has-note { background: #e8f0fe; border-color: var(--primary); color: #1b2340; }
.mcr-air { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; cursor: pointer; }
.mcr-air input { width: 22px; height: 22px; accent-color: var(--primary); cursor: pointer; }
.mcr-box { width: 100%; box-sizing: border-box; min-height: 220px; padding: 12px 14px; font: inherit; font-size: 15px; line-height: 1.6; border: 1px solid var(--border); border-radius: 10px; resize: vertical; }
@media print { .gl-mcr { display: none; } }

/* Booking: a session that belongs to a repeating series */
.bk-series { margin: 6px 0; padding: 7px 10px; border: 1px solid #cfe0fb; border-radius: 8px; background: #eef4fe; color: #1b2340; font-size: 13px; line-height: 1.4; }

/* Booking windows: buttons in the footer all the same size; invited people shown as groups */
.bk-sheet .modal-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-sheet .modal-foot .spacer { display: none; }
.bk-sheet .modal-foot .btn { flex: 1 1 120px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.bk-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.bk-group { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid #cfe0fb; border-radius: 999px; background: #eef4fe; color: #1b2340; font-size: 13px; cursor: default; }
.bk-group b { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #1b2340; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* Edit booking: invited people as groups — click a group to slide its people open */
.bk-gp { display: inline-flex; align-items: center; border: 1px solid #cfe0fb; border-radius: 999px; background: #eef4fe; color: #1b2340; font-size: 13px; overflow: hidden; }
.bk-gp.open { border-color: #1b2340; background: #fff; }
.bk-gp-head { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: inherit; font: inherit; padding: 4px 6px 4px 10px; cursor: pointer; }
.bk-gp-head b { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #1b2340; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.bk-gp-head i { font-style: normal; font-size: 10px; color: #6b7280; }
.bk-gp-x { border: 0; background: none; color: #6b7280; cursor: pointer; font-size: 15px; padding: 0 8px 0 2px; }
.bk-gp-x:hover { color: #b42318; }
.bk-gp-panel { flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 4px 10px; border-left: 3px solid #cfe0fb; margin: 0 0 4px 4px; animation: bkGpOpen .18s ease-out; transform-origin: top; }
@keyframes bkGpOpen { from { opacity: 0; transform: translateY(-6px) scaleY(.85); } to { opacity: 1; transform: none; } }

.bk-bar .bk-markchips .mark-chip { padding: 3px 10px; font-size: 13px; }

/* Notes: Arabic (or any right-to-left) text runs right-to-left, line by line; English stays left-to-right */
.bk-notes, .bk-notes-field textarea { unicode-bidi: plaintext; text-align: start; }

/* ---- Engineering Service (technical problems on air) -------------------------------------------------------- */
.eg { max-width: 1240px; margin: 0 auto; }
.eg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.eg-bar h1 { font-size: 20px; margin: 0 10px 0 0; }
.eg-bar .spacer { flex: 1; }
.eg-pill { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.eg-pill.on { background: #1b2340; color: #fff; border-color: #1b2340; }
.eg-newbtn { display: none; }
.eg-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.eg-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 16px; min-width: 110px; }
.eg-stat b { display: block; font-size: 22px; }
.eg-stat small { color: var(--text-muted); }
.eg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.eg-grid.eg-readonly { grid-template-columns: minmax(0, 1fr); }
.eg-empty { color: var(--text-muted); }
.eg-inc { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.eg-inc.eg-open { border-left: 4px solid var(--primary); background: #f7faff; }
.eg-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eg-meta { color: var(--text-muted); font-size: 13px; margin: 2px 0 6px; }
.eg-txt { white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; }
.eg-badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.eg-sev-air { background: #b42318; color: #fff; }
.eg-sev-minor { background: #fdf0d5; color: #a15c07; }
.eg-sev-none { background: #eef0f4; color: #67707f; }
.eg-st-open { background: #e8f0fe; color: #1d4ed8; }
.eg-st-prog { background: #fdf0d5; color: #a15c07; }
.eg-st-done { background: #dff3e7; color: #177245; }
.eg-cat { background: #eef0f4; color: #374151; }
.eg-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.eg-acts button { font: inherit; font-size: 12px; padding: 4px 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--text); }
.eg-acts button:hover { background: #eef4fe; }
.eg-acts .eg-danger { color: var(--danger); }
.eg-form h2 { margin: 0 0 2px; font-size: 17px; }
.eg-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin: 12px 0 4px; }
.eg-form input, .eg-form select, .eg-form textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; color: var(--text); border: 1px solid #cdd3dd; border-radius: 8px; padding: 8px 10px; background: #fff; }
.eg-form textarea { min-height: 110px; resize: vertical; unicode-bidi: plaintext; text-align: start; }
.eg-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.eg-sev { display: flex; gap: 8px; }
.eg-sev button { flex: 1; padding: 8px 4px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); }
.eg-sev button.on[data-s="air"] { background: #b42318; color: #fff; border-color: #b42318; }
.eg-sev button.on[data-s="minor"] { background: #fdf0d5; border-color: #e8c36a; }
.eg-sev button.on[data-s="none"] { background: #e8f0fe; border-color: #9dbdf5; }
.eg-alert { margin-top: 12px; background: #e8f0fe; border: 1px solid #cfe0fb; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.eg-formbtns { margin-top: 14px; display: flex; gap: 8px; }
.eg-formbtns .btn-primary { flex: 1; }
@media (max-width: 900px) {
  .eg-grid { grid-template-columns: minmax(0, 1fr); }
  .eg-newbtn { display: inline-flex; }
  .eg-side { display: none; order: -1; }
  .eg-side.open { display: block; }
  .eg-row2 { grid-template-columns: 1fr; }
}

.eg-day { display: inline-flex; gap: 6px; flex-wrap: nowrap; align-items: center; }

/* ---- dark blue header (same navy as the Engineering offline test bar) ---- */
.topbar { background: #1b2340; border-bottom: 1px solid #0f1530; color: #fff; }
.topbar .topbar-brand { color: #fff; }
.topbar .navlink { color: rgba(255, 255, 255, 0.72); }
.topbar .navlink:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.topbar .navlink[aria-current="page"] { background: rgba(255, 255, 255, 0.16); color: #fff; }
.topbar .who { color: #fff; }
.topbar .btn-ghost { color: rgba(255, 255, 255, 0.85); }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.topbar .topbar-toggle { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: transparent; }
.topbar .topbar-toggle:hover { background: rgba(255, 255, 255, 0.12); }

/* MCR notes (from the Guest list) inside the Engineering log: light blue, never pink */
.eg-inc.eg-mcr { background: #eef4fe; border-color: #cfe0fb; border-left: 4px solid #1b2340; }
.eg-mcrb { background: #1b2340; color: #fff; }

.eg-dayh { font-size: 13px; font-weight: 700; color: #1b2340; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.eg-dayh:first-child { margin-top: 0; }
.eg-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.eg-seg button { border: 0; background: var(--surface); font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer; color: var(--text); }
.eg-seg button.on { background: #1b2340; color: #fff; }

/* ---- Dashboard tabs + Engineering report ---- */
.dash-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-tab { border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; padding: 9px 18px; border-radius: 10px; cursor: pointer; color: var(--text-muted); }
.dash-tab:hover { color: var(--text); background: #eef4fe; }
.dash-tab.on { background: #1b2340; border-color: #1b2340; color: #fff; }
.er-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.er-actions .spacer { flex: 1; }
.er-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.er-seg button { border: 0; background: var(--surface); font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer; color: var(--text); border-right: 1px solid var(--border); }
.er-seg button:last-child { border-right: 0; }
.er-seg button:hover { background: #eef4fe; }
.er-period { margin: 0 0 12px; }
.er-empty { background: #eef4fe; border: 1px solid #cfe0fb; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.er-insights { background: #eef4fe; border: 1px solid #cfe0fb; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.er-insights h3 { margin: 0 0 6px; font-size: 15px; }
.er-insights ul { margin: 0; padding-left: 20px; } .er-insights li { margin: 3px 0; }
.er-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.er-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.er-kpi b { font-size: 26px; display: block; } .er-kpi small { color: var(--text-muted); }
.er-d { font-size: 12px; margin-top: 2px; color: var(--text-muted); } .er-d.up { color: #b42318; } .er-d.dn { color: #177245; }
.er-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.er-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.er-card h3 { margin: 0 0 2px; font-size: 15px; } .er-sub { color: var(--text-muted); font-size: 12px; margin: 0 0 10px; }
.er-wide { grid-column: 1 / -1; }
.er-row { display: grid; grid-template-columns: 150px 1fr 34px; gap: 8px; align-items: center; margin: 5px 0; font-size: 13px; }
.er-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er-track { background: #eef1f6; border-radius: 6px; height: 16px; overflow: hidden; display: block; }
.er-fill { display: block; height: 100%; background: #1b2340; border-radius: 6px; }
.er-v { text-align: right; font-weight: 600; }
.er-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; }
.er-hours div { height: 38px; border-radius: 4px; }
.er-hlab { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 3px; }
.er-trend { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.er-trend div { flex: 1; background: #dbe7fb; border-radius: 3px 3px 0 0; position: relative; min-width: 3px; }
.er-trend div i { position: absolute; bottom: 0; left: 0; right: 0; background: #1b2340; border-radius: 3px 3px 0 0; }
.er-tlab { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.er-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.er-table th, .er-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.er-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; } .er-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.er-badge { font-size: 11px; font-weight: 700; background: #1b2340; color: #fff; padding: 1px 8px; border-radius: 999px; }
@media (max-width: 860px) { .er-grid { grid-template-columns: 1fr; } .er-row { grid-template-columns: 110px 1fr 30px; } }
@media print { .topbar, .bottom-nav, .dash-head, .dash-tabs, .er-actions { display: none !important; } body { background: #fff; } }

/* ---- tabs v2: dark blue active tab, white rounded tabs (Home, Admin Console, Guests; same look as the Dashboard tabs) ---- */
body.tabs-v2 .tabbar { gap: 6px; flex-wrap: wrap; border-bottom: none; margin: 0 0 14px; }
body.tabs-v2 .tabbar .tab-btn { position: static; top: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 10px; padding: 9px 18px; font-weight: 600; font-size: 14px; box-shadow: none; margin: 0; }
body.tabs-v2 .tabbar .tab-btn:hover { background: #eef4fe; color: var(--text); filter: none; }
body.tabs-v2 .tabbar .tab-btn.is-active { background: #1b2340; border-color: #1b2340; color: #fff; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 9px 18px; margin: 0; }
body.tabs-v2 .tabbar .tab-btn.is-active:hover { background: #1b2340; filter: none; }
body.tabs-v2 .console-tabs .tab-btn { padding: 9px 14px; }

/* ---- Tab look v2 for the filter / mode buttons (Daily Plan, Booking Day/Week, Engineering, Report): same dark blue active + white rounded ---- */
body.tabs-v2 .plan-quick, body.tabs-v2 .bk-seg { gap: 6px; }
body.tabs-v2 .plan-quick .btn, body.tabs-v2 .bk-seg .btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 10px;
  padding: 6px 14px; font-weight: 600; box-shadow: none; margin: 0;
}
body.tabs-v2 .plan-quick .btn:hover, body.tabs-v2 .bk-seg .btn:hover { background: #eef4fe; color: var(--text); filter: none; }
body.tabs-v2 .plan-quick .btn.is-active, body.tabs-v2 .bk-seg .btn.is-active,
body.tabs-v2 .plan-quick .btn.is-active:hover, body.tabs-v2 .bk-seg .btn.is-active:hover {
  background: #1b2340; border-color: #1b2340; color: #fff; box-shadow: none; filter: none;
}
body.tabs-v2 .bk-seg .btn:first-child, body.tabs-v2 .bk-seg .btn:last-child { border-radius: 10px; margin-left: 0; }
body.tabs-v2 .eg-seg, body.tabs-v2 .er-seg { border: 0; border-radius: 0; overflow: visible; gap: 6px; }
body.tabs-v2 .eg-seg button, body.tabs-v2 .er-seg button, body.tabs-v2 .eg-pill {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 10px; padding: 6px 14px; font-weight: 600;
}
body.tabs-v2 .er-seg button:last-child { border: 1px solid var(--border); }
body.tabs-v2 .eg-seg button:hover, body.tabs-v2 .er-seg button:hover, body.tabs-v2 .eg-pill:hover { background: #eef4fe; color: var(--text); }
body.tabs-v2 .eg-seg button.on, body.tabs-v2 .er-seg button.on, body.tabs-v2 .eg-pill.on,
body.tabs-v2 .eg-seg button.on:hover, body.tabs-v2 .er-seg button.on:hover, body.tabs-v2 .eg-pill.on:hover {
  background: #1b2340; border-color: #1b2340; color: #fff;
}

/* Guest list card — 6 columns (Name, Title, Email, Telephone, Guest Location, Connection Type) and the Assignment edit mode */
.gl-tbl .gl-name { width: 18%; } .gl-tbl .gl-title { width: 22%; } .gl-tbl .gl-mail { width: 24%; } .gl-tbl .gl-tel { width: 12%; }
.gl-tbl .gl-loc { width: 10.5%; } .gl-tbl .gl-conn { width: 10.5%; } .gl-tbl .gl-x { width: 34px; text-align: center; padding-left: 0; padding-right: 0; } /* Title and Email get the most room; the × column is fixed */
.gl-in { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); }
.gl-in:focus { outline: 2px solid #60a5fa; outline-offset: 0; }
.gl-namewrap { display: flex; align-items: center; gap: 8px; } /* the translation icon sits in the same row as the name box */
.gl-namewrap .gl-globe { flex: 0 0 auto; margin: 0; }
.gl-namewrap .gl-in { flex: 1 1 auto; min-width: 0; }
.gl-del { border: 0; background: transparent; color: #8a93a6; font-size: 20px; line-height: 1; cursor: pointer; border-radius: 8px; padding: 2px 8px; }
.gl-del:hover { background: #eef4fe; color: #1b2340; }
.gl-add { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-top: 10px; border-radius: 50%; border: 1.5px solid #1b2340; background: #fff; color: #1b2340; font-size: 22px; line-height: 1; cursor: pointer; }
.gl-add:hover { background: #1b2340; color: #fff; }
@media print { .gl-add, .gl-del, .gl-x { display: none !important; } }
.gl-print .gl-tbl .gl-loc, .gl-print .gl-tbl .gl-conn { font-size: 11.5px; }

/* Guest list: "+ New item" form card and the "added by Assignment" label */
.gl-bar .gl-new { font-weight: 600; border: 1.5px solid #1b2340; }
.gl-badge { background: #e8f0fe; color: #1d4ed8; border-radius: 8px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; align-self: center; }
.gl-itemact { display: inline-flex; gap: 6px; align-self: center; }
.gl-row1 { flex-wrap: wrap; gap: 8px 12px; }
.gl-form { background: #fff; }
.gl-formtitle { font-weight: 700; color: #1b2340; margin-bottom: 10px; }
.gl-formgrid { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 14px; margin-bottom: 12px; }
.gl-formgrid label, .gf-label { display: block; font-size: 12.5px; color: var(--text-muted); }
.gl-formgrid .gl-in { margin-top: 3px; }
.gf-topic { grid-column: 1 / -1; }
.gf-guests { display: grid; gap: 6px; margin-bottom: 8px; }
.gf-guests #gf-guestlist { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media print { .gl-badge, .gl-itemact { display: none !important; } }

/* Guest list card: the dark blue time + show bar is only as long as its text, with rounded edges (screen only; the paper copy keeps its own shape) */
@media screen {
  .gl-pill { box-sizing: border-box; width: 340px; min-width: 0; max-width: 100%; gap: 22px; padding: 8px 20px; border-radius: 14px; font-size: 15px; } /* the same size on every card */
  .gl-pill .gl-ptime { flex: 0 0 auto; }
  .gl-pill .gl-pshow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* the translation globe as a switch on the editable Guest list cards */
.gl-tr { border: 0; background: transparent; padding: 0; line-height: 0; cursor: pointer; border-radius: 50%; flex: 0 0 auto; }
.gl-tr:not(.on) svg { opacity: 0.14; }
.gl-tr:not(.on):hover svg { opacity: 0.45; }
.gl-tr:disabled { cursor: default; }

/* E-mail the plan pop-up */
.pe-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.pe-prevhead { margin-top: 4px; }
.pe-preview { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; max-height: 360px; overflow: auto; }
.pe-sheet .modal { max-width: 96vw; }

/* Rota: "Today" (one day) and "This week" buttons in the sidebar nav, compact so they fit with the arrows and the lock switch */
.rs-nav { gap: 4px; }
.rs-nav .btn, .slim-nav .btn { padding: 5px 7px; font-size: 12px; white-space: nowrap; }
.rs-nav .btn[data-wk="prev"], .rs-nav .btn[data-wk="next"] { padding: 5px 8px; }
.rs-nav .btn.is-active, .slim-nav .btn.is-active { background: #1b2340; border-color: #1b2340; color: #fff; }

.pe-gchip { background: #1b2340; color: #fff; }
.pe-gchip small { color: #cdd5f0; }

/* Guest list card: the Notes column (per guest) — the widths now add up with it */
.gl-tbl .gl-name { width: 16%; } .gl-tbl .gl-title { width: 17%; } .gl-tbl .gl-mail { width: 19%; } .gl-tbl .gl-tel { width: 11%; }
.gl-tbl .gl-loc { width: 9.5%; } .gl-tbl .gl-conn { width: 9.5%; } .gl-tbl .gl-note { width: 15%; }

/* Guest list card: the note sits UNDER the guest's line, full width (Notes is no longer a column) */
.gl-tbl .gl-name { width: 17%; } .gl-tbl .gl-title { width: 20%; } .gl-tbl .gl-mail { width: 24%; } .gl-tbl .gl-tel { width: 15%; }
.gl-tbl .gl-loc { width: 11%; } .gl-tbl .gl-conn { width: 11%; }
.gl-tbl tr.gl-hasnote > td { border-bottom: 0; padding-bottom: 6px; }
.gl-tbl .gl-noterow > td { padding: 0 8px 12px; border-bottom: 1.5px solid #b4b8c0; }
.gl-note-in { display: block; width: 100%; box-sizing: border-box; resize: vertical; min-height: 36px; line-height: 1.5; overflow: hidden; }
.gl-note-text { color: #4b5563; font-style: italic; line-height: 1.6; white-space: pre-line; padding: 0 2px; }
@media print { .gl-print .gl-note-text { font-size: 12px; } .gl-print .gl-tbl .gl-noterow > td { padding-bottom: 8px; } }
.gl-tbl .gl-tel { white-space: nowrap; overflow-wrap: normal; } /* a phone number never breaks in the middle; several numbers are one per line */

/* the card's footer: + (add a guest), then Edit / Delete for cards added by Assignment */
.gl-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.gl-foot .gl-add { margin-top: 0; }
@media print { .gl-foot { display: none !important; } }

/* Guest list: a card that started more than one hour ago (today) is light blue, so you can see what is finished (screen only) */
#plan-cards .gl-card.gl-past { background: #eaf3fc; border-color: #bcd4ee; opacity: .75; transition: opacity .15s; }
#plan-cards .gl-card.gl-past:hover, #plan-cards .gl-card.gl-past:focus-within { opacity: .95; }

/* Add Guest pop-up: Rank (stars) column */
.guestpick-item, .guestpick-cols { grid-template-columns: 18px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.5fr) 84px minmax(0, 0.7fr) minmax(0, 0.5fr) minmax(0, 2fr); }
.gp-stars { color: #f5a623; letter-spacing: 1px; font-size: 14px; white-space: nowrap; } .gp-star-off { color: #d5d8de; }
@media (max-width: 700px) { .guestpick-item { grid-template-columns: 18px minmax(0, 1fr); } .guestpick-item .gp-rank { grid-column: 2; } }

/* Live (dark blue, as before) or Coverage (glassy green, the rota's EXT colour) on a Guest list card */
.gl-card.gl-cov { border-color: #0f4a28; }
.gl-card.gl-cov .gl-pill { background: linear-gradient(180deg, rgba(15, 74, 40, 0.96), rgba(20, 110, 58, 0.9)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 6px rgba(15, 74, 40, 0.3); }
.gf-kind { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.gf-kopt { cursor: pointer; }
.gf-kopt input { position: absolute; opacity: 0; pointer-events: none; }
.gf-kopt span { display: inline-block; padding: 7px 20px; border-radius: 18px; border: 1.5px solid #b4b8c0; font-weight: 600; font-size: 14px; background: #fff; color: #1b2340; }
.gf-live input:checked + span { background: #1b2340; border-color: #1b2340; color: #fff; }
.gf-cov input:checked + span { background: linear-gradient(180deg, rgba(15, 74, 40, 0.96), rgba(20, 110, 58, 0.9)); border-color: #0f4a28; color: #fff; }
.gf-kopt input:focus-visible + span { outline: 2px solid rgba(31, 111, 235, 0.5); outline-offset: 2px; }

/* Guest list card with a guest who needs translation: Translator + Translator Location columns (narrower columns to make room) */
.gl-tbl.gl-tr2 .gl-name { width: 14%; } .gl-tbl.gl-tr2 .gl-title { width: 15%; } .gl-tbl.gl-tr2 .gl-mail { width: 18%; } .gl-tbl.gl-tr2 .gl-tel { width: 12%; }
.gl-tbl.gl-tr2 .gl-loc { width: 10%; } .gl-tbl.gl-tr2 .gl-conn { width: 10%; } .gl-tbl.gl-tr2 .gl-trn { width: 11%; } .gl-tbl.gl-tr2 .gl-trl { width: 10%; }

/* Daily Plan search box (top right of the toolbar) and its results pop-up */
.plan-bar .plan-search { margin-left: auto; }
.plan-search input { width: 300px; max-width: 42vw; padding: 7px 12px; border: 1.5px solid #b4b8c0; border-radius: 10px; font: inherit; font-size: 14px; background: #fff; }
.plan-search input:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }
.ps-note { margin: 0 0 10px; }
.ps-wrap { max-height: 64vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.ps-tbl { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.ps-tbl thead th { position: sticky; background: var(--surface); text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); padding: 8px 8px 4px; z-index: 2; }
.ps-tbl thead tr:first-child th { top: 0; cursor: pointer; user-select: none; }
.ps-tbl thead tr.ps-filters th { top: 31px; padding: 0 6px 8px; cursor: default; border-bottom: 1px solid var(--border); }
.ps-tbl thead .ps-tick { width: 38px; text-align: center; cursor: default; }
.ps-filters input, .ps-filters select { width: 100%; box-sizing: border-box; font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; text-transform: none; letter-spacing: 0; }
.ps-arrow { color: var(--primary); font-size: 10px; }
.ps-tbl td { padding: 8px; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.ps-tbl td.ps-tick { text-align: center; } .ps-tbl td.ps-nm { text-align: center; font-weight: 700; }
.ps-tbl tbody tr { cursor: pointer; } .ps-tbl tbody tr:hover { background: var(--surface); } .ps-tbl tbody tr.is-on { background: #eaf3fc; }
.ps-topic { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; line-height: 1.5; }
.ps-none { text-align: center; padding: 24px; }
.gl-pdate { font-weight: 500; opacity: .85; }

/* Dashboard -> Guests tab */
.gs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 1000px) { .gs-grid { grid-template-columns: minmax(0, 1fr); } }
.gs-grid .card h3, #dash-guests .card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: 16px 0 6px; }
.gs-note { margin: 10px 0 0; }
.gs-wrap { overflow-x: auto; }
.gs-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.gs-tbl th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--border); font-weight: 600; }
.gs-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.gs-tbl .gs-num { text-align: end; white-space: nowrap; }
.gs-stars { color: #f5a623; letter-spacing: 1px; white-space: nowrap; } .gs-off { color: #d5d8de; }
.gs-bars { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gs-bars li { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13px; }
.gs-bt { background: #eaf3fc; border-radius: 6px; height: 12px; overflow: hidden; } .gs-bf { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.gs-bv { text-align: end; font-weight: 600; }
.gs-warn .dash-stat-num { color: #9b1c1c; }

.gs-nowrap { white-space: nowrap; }

.gp-corr { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 7px; border-radius: 8px; background: #eaf3fc; color: #1b4f8f; vertical-align: middle; }

/* Record: the glassy dark red of the REC slot on the rota */
.gl-card.gl-rec { border-color: #5c1414; }
.gl-card.gl-rec .gl-pill { background: linear-gradient(180deg, rgba(92, 20, 20, 0.95), rgba(130, 26, 26, 0.88)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 6px rgba(92, 20, 20, 0.35); }
.gf-rec input:checked + span { background: linear-gradient(180deg, rgba(92, 20, 20, 0.95), rgba(130, 26, 26, 0.88)); border-color: #5c1414; color: #fff; }

/* Home -> Daily Report (My Work) */
.td-pick { width: 38px; text-align: center; } .td-done { color: #1f9d55; font-weight: 700; }
.td-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
#wr-host { margin-top: 16px; }
.wr-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .wr-bar h2 { margin: 0; }
.wr-warn { color: #9b1c1c; font-weight: 600; }
.wr-scroll { overflow-x: auto; margin-top: 8px; }
.wr-tbl { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 13.5px; }
.wr-tbl th { background: #0b1f4d; color: #fff; text-align: left; padding: 8px 10px; font-size: 13px; border: 1px solid #b9d6e8; white-space: nowrap; }
.wr-tbl td { padding: 6px 8px; vertical-align: top; border: 1px solid #b9d6e8; }
.wr-tbl tbody tr:nth-child(odd) { background: #dff1fb; } .wr-tbl tbody tr:nth-child(even) { background: #fff; }
.wr-nowrap { white-space: nowrap; } .wr-topic { max-width: 280px; white-space: pre-line; }
.wr-in { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 5px 7px; border: 1px solid #b4b8c0; border-radius: 6px; background: #fff; }
textarea.wr-in { resize: vertical; min-height: 46px; line-height: 1.4; }
.wr-in:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }
.wr-tbl td:nth-child(5) { min-width: 130px; } .wr-tbl td:nth-child(6) { min-width: 230px; } .wr-tbl td:nth-child(7) { min-width: 150px; }
.wr-time { width: 96px; } .wr-t.wr-need { border: 2px solid #9b1c1c; }
.wr-dur { white-space: nowrap; font-weight: 600; color: #1b2340; }
.wr-open { text-decoration: none; font-weight: 700; } .wr-x { width: 34px; text-align: center; }
.wr-add { margin-top: 12px; }

/* Daily Report: bigger fields (the Today tab now uses the full page width) */
.wr-tbl { min-width: 1500px; font-size: 15px; }
.wr-tbl th { font-size: 14px; padding: 10px 12px; }
.wr-tbl td { padding: 9px 10px; }
.wr-in { font-size: 15px; padding: 8px 10px; border-radius: 8px; }
textarea.wr-in { min-height: 68px; line-height: 1.45; }
.wr-tbl td:nth-child(5) { min-width: 180px; } .wr-tbl td:nth-child(6) { min-width: 340px; } .wr-tbl td:nth-child(7) { min-width: 230px; }
.wr-time { width: 110px; } .wr-dur { font-size: 15px; }
.wr-topic { max-width: 340px; }

/* Work reports, phase 2 */
.wr-crow td { background: #eaf3fc !important; border-top: 0; padding: 6px 12px; }
.wr-comment { font-size: 13.5px; margin: 2px 0; }
.dash-jt-box { position: relative; height: 340px; margin-top: 8px; }
.tm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .tm-bar h2 { margin: 0; }
.tm-presets { display: inline-flex; gap: 6px; } .tm-dept { max-width: 220px; } .tm-q { max-width: 220px; }
.tm-tbl th { cursor: pointer; user-select: none; white-space: nowrap; } .tm-row { cursor: pointer; } .tm-row:hover { background: #eaf3fc; }
.te-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; } .te-chip { background: #eaf3fc; border-radius: 14px; padding: 4px 12px; font-size: 13px; }
.te-day { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; background: #fff; }
.te-dayhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.te-stars .star-btn { font-size: 24px; } .te-note { max-width: 320px; }
.te-desc { white-space: pre-line; } .te-tbl td { vertical-align: top; }
.te-crow td { background: #eaf3fc; border-bottom: 1px solid var(--border); }
.te-comment { font-size: 13.5px; margin: 2px 0; } .te-cdel { border: 0; background: none; color: #9b1c1c; cursor: pointer; font-size: 16px; }
.te-add { display: flex; gap: 8px; } .te-add .input { flex: 1; }

/* Staff tab: the Shifts block sits under Staff / Studios, full width, without the divider line */
@media (min-width: 900px) { .dash-top .dash-block:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; } }

/* Dashboard: every stat box has the same size */
.dash-stats .dash-stat-pill { box-sizing: border-box; width: 150px; min-width: 150px; height: 86px; justify-content: center; text-align: center; padding: 8px 10px; }
.dash-stats .dash-stat-label { text-align: center; line-height: 1.25; }

/* Dashboard, Staff tab: a calm grid. Staff on top over the full width; Studios and Shifts side by side under it; every box the same size, no divider lines inside the rows */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fill, 150px); gap: 12px; justify-content: start; margin-top: 12px; }
.dash-stats .dash-stat-sep { display: none; }
.dash-block h2 { font-size: 17px; letter-spacing: 0.01em; }
@media (min-width: 900px) {
  .dash-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 40px; }
  .dash-top .dash-block:nth-child(1) { grid-column: 1 / -1; }
  .dash-top .dash-block:nth-child(n+2) { grid-column: auto; border-left: 0; padding-left: 0; border-top: 1px solid var(--border, #e3e7ee); padding-top: 22px; }
}

/* Daily Report: fixed column widths - Topic gets the free space, Job Type and Link are short */
.wr-tbl { table-layout: fixed; min-width: 1500px; }
.wr-tbl td:nth-child(5), .wr-tbl td:nth-child(6), .wr-tbl td:nth-child(7) { min-width: 0; }
.wr-topic { max-width: none; }
.wr-tbl th:nth-child(1) { width: 70px; }  .wr-tbl th:nth-child(2) { width: 150px; }
.wr-tbl th:nth-child(4) { width: 150px; } .wr-tbl th:nth-child(5) { width: 128px; }
.wr-tbl th:nth-child(6) { width: 300px; } .wr-tbl th:nth-child(7) { width: 118px; }
.wr-tbl th:nth-child(8), .wr-tbl th:nth-child(9) { width: 96px; } .wr-tbl th:nth-child(10) { width: 92px; } .wr-tbl th:nth-child(11) { width: 40px; }
.wr-tbl td { overflow-wrap: anywhere; }

/* Dashboard header: the Department box */
.dash-range .dr-dept { width: auto; min-width: 190px; padding: 8px 12px; border-radius: 10px; }

.gs-grid.gs-one { grid-template-columns: minmax(0, 1fr); }

/* Guests tab: Translation card on top; "How guests join" = two columns with a separator */
#dash-guests > .card { margin-bottom: 16px; }
.gs-join { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 40px; }
@media (min-width: 900px) { .gs-join { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .gs-join-col + .gs-join-col { border-left: 1px solid var(--border, #e3e7ee); padding-left: 40px; } }
.gs-join-col h3 { margin-top: 8px; }

.gs-pair { margin-top: 0; margin-bottom: 16px; }

/* Dashboard -> Staff -> Performance report box */
@media (min-width: 900px) { .dash-top .dash-block.dash-report { grid-column: 1 / -1; } }
.dash-rep-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.dash-rep-row .input { width: 340px; max-width: 100%; }

/* The Performance Report page (on screen in the pop-up and on A4 paper) */
.pr-page { background: #fff; color: #1b2340; font-size: 14px; }
.pr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.pr-hl h1 { margin: 0; font-size: 34px; letter-spacing: 0.02em; color: #1b2340; }
.pr-dept { margin: 6px 0 4px; font-size: 15px; letter-spacing: 0.04em; }
.pr-name { font-size: 18px; margin: 4px 0; } .pr-name span { font-weight: 400; color: #4b5563; }
.pr-period { margin: 8px 0 2px; font-size: 16px; } .pr-period b { background: #e9edf3; padding: 4px 12px; border-radius: 4px; font-weight: 600; margin-left: 6px; }
.pr-auto { font-style: italic; font-size: 13px; color: #4b5563; margin-top: 6px; }
.pr-photo { flex: none; width: 150px; height: 150px; border-radius: 50%; overflow: hidden; background: #dbe6f5; display: grid; place-items: center; font-size: 46px; font-weight: 700; color: #1b2340; }
.pr-photo img { width: 100%; height: 100%; object-fit: cover; }
.pr-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 20px; }
.pr-kpi { background: #eaf3fc; border-radius: 10px; padding: 12px 14px; text-align: center; }
.pr-kpi h4 { margin: 0 0 4px; font-size: 14px; } .pr-big { font-size: 30px; font-weight: 700; color: #1b2340; line-height: 1.2; } .pr-big small { font-size: 14px; font-weight: 600; color: #2f5fb3; }
.pr-src { font-size: 12px; color: #4b5563; }
.pr-h { margin: 14px 0 6px; font-size: 17px; letter-spacing: 0.03em; color: #1b2340; }
.pr-tbl { width: 100%; border-collapse: separate; border-spacing: 0 3px; font-size: 14px; }
.pr-tbl th { background: #1b2340; color: #fff; text-align: left; padding: 8px 10px; font-weight: 600; font-size: 13px; letter-spacing: 0.03em; }
.pr-tbl td { background: #f1f4f8; padding: 8px 10px; vertical-align: middle; }
.pr-tbl .pr-sub2 th { background: #2f5fb3; font-weight: 500; }
.pr-c { text-align: center; white-space: nowrap; } .pr-t { white-space: nowrap; } .pr-sub { font-size: 11px; color: #4b5563; }
.pr-w { white-space: nowrap; text-align: center; width: 150px; } .pr-x { width: 34px; text-align: center; }
.pr-stars { color: #f5b301; letter-spacing: 1px; font-size: 18px; } .pr-off { color: #d5d8de; }
.pr-star { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: #d5d8de; padding: 0 1px; } .pr-star.on { color: #f5b301; } .pr-star:hover { color: #e0a700; }
.pr-in { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid #b4b8c0; border-radius: 6px; background: #fff; }
.pr-num { width: 70px; text-align: center; } textarea.pr-in { resize: vertical; }
.pr-empty { color: #6b7280; text-align: center; font-style: italic; }
.pr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 16px; align-items: start; }
.pr-dist { background: #f1f4f8; border-radius: 8px; padding: 6px 14px 12px; }
.pr-donut { display: flex; align-items: center; gap: 18px; } .pr-donut img, .pr-donut canvas { width: 170px; height: 170px; flex: none; }
.pr-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; } .pr-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 8px; }
.pr-iadd { margin-top: 6px; }
.pr-extra { margin-top: 16px; background: #f1f4f8; border-radius: 8px; padding: 4px 14px 14px; } .pr-extra-text { min-height: 90px; white-space: pre-line; }
.pr-sign { margin-top: 14px; } .pr-signer { margin-top: 4px; } .pr-line { width: 260px; border-bottom: 1.5px solid #1b2340; height: 46px; }
.pr-foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #b4b8c0; font-size: 12px; color: #374151; }
@media screen and (max-width: 760px) { .pr-two, .pr-kpis { grid-template-columns: 1fr; } .pr-head { flex-direction: column-reverse; } }
.print-area.pr-printing .pr-page { font-size: 12px; line-height: 1.3; }
.print-area.pr-printing .pr-hl h1 { font-size: 26px; } .print-area.pr-printing .pr-dept { margin: 3px 0 2px; font-size: 13px; } .print-area.pr-printing .pr-name { font-size: 15px; margin: 2px 0; }
.print-area.pr-printing .pr-period { margin: 5px 0 1px; font-size: 13px; } .print-area.pr-printing .pr-auto { font-size: 11px; margin-top: 3px; }
.print-area.pr-printing .pr-photo { width: 104px; height: 104px; font-size: 34px; }
.print-area.pr-printing .pr-kpis { margin: 10px 0 8px; gap: 10px; } .print-area.pr-printing .pr-kpi { padding: 7px 10px; }
.print-area.pr-printing .pr-kpi h4 { font-size: 12px; margin-bottom: 2px; } .print-area.pr-printing .pr-big { font-size: 22px; } .print-area.pr-printing .pr-big small { font-size: 12px; } .print-area.pr-printing .pr-src { font-size: 10px; }
.print-area.pr-printing .pr-h { margin: 8px 0 4px; font-size: 14px; }
.print-area.pr-printing .pr-tbl { font-size: 12px; border-spacing: 0 2px; }
.print-area.pr-printing .pr-tbl th { padding: 5px 8px; font-size: 11px; } .print-area.pr-printing .pr-tbl td { padding: 4px 8px; }
.print-area.pr-printing .pr-stars { font-size: 15px; } .print-area.pr-printing .pr-sub { font-size: 10px; }
.print-area.pr-printing .pr-two { margin-top: 8px; gap: 14px; }
.print-area.pr-printing .pr-dist { padding: 2px 10px 8px; } .print-area.pr-printing .pr-donut img { width: 118px; height: 118px; } .print-area.pr-printing .pr-legend { font-size: 12px; gap: 2px; }
.print-area.pr-printing .pr-extra { margin-top: 8px; padding: 2px 10px 8px; } .print-area.pr-printing .pr-extra-text { min-height: 54px; font-size: 12px; }
.print-area.pr-printing .pr-sign { margin-top: 8px; } .print-area.pr-printing .pr-line { height: 30px; width: 220px; }
.print-area.pr-printing .pr-foot { margin-top: 8px; padding-top: 5px; font-size: 10px; }
.print-area.pr-printing .print-foot { display: none; }
}

/* Dashboard header card: dates on the left, the Performance report search on the right */
@media (min-width: 1000px) { .dash-head { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 32px; } }
.dash-head-l { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dash-head-r h2 { margin: 6px 0 12px; font-size: 18px; }
.dash-head-r .dash-rep-row { margin-top: 0; }
.dash-head .dr-name { width: 320px; max-width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.dash-head .dr-name::placeholder { font-weight: 400; color: var(--text-muted); }
.dash-head .dr-name:focus { outline: 2px solid rgba(31, 111, 235, 0.35); border-color: var(--primary); }
.dash-head .dr-gen { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; }
.dash-head .dr-gen:not(:disabled):hover { background: var(--surface-2); border-color: var(--primary); }
.dash-head .dr-gen:disabled { opacity: 0.55; }

/* a little space between the cards of a Dashboard tab */
.dash-panel > .card + .card, #dash-jt-card { margin-top: 16px; }

/* Daily Report: the Initiative icon column (inserted before Duration) */
.wr-tbl th:nth-child(10) { width: 58px; } .wr-tbl th:nth-child(11) { width: 92px; } .wr-tbl th:nth-child(12) { width: 40px; }
.wr-ini { text-align: center; width: 58px; }
.wr-initbtn { border: 1.5px solid #b4b8c0; background: #fff; border-radius: 50%; width: 38px; height: 38px; font-size: 18px; line-height: 1; cursor: pointer; filter: grayscale(1); opacity: 0.55; }
.wr-initbtn:hover { opacity: 0.9; }
.wr-initbtn.on { filter: none; opacity: 1; border-color: #1b2340; background: #eaf3fc; box-shadow: 0 0 0 2px rgba(27, 35, 64, 0.15); }
.pr-hist { max-width: 340px; margin-left: 12px; }
.pr-two { grid-template-columns: 1.25fr 1fr; }

/* Performance report search: on the same line as the dates (inside the date form) */
.dash-range .dr-name { margin-left: 18px; width: 260px; }
@media (max-width: 700px) { .dash-range .dr-name { margin-left: 0; width: 100%; } }

/* The printed report: the page margin is made by the sheet itself (padding), so the browser's own header and footer (address, date, page number) are not printed */
.print-area.pr-printing { box-sizing: border-box; width: 210mm; padding: 10mm; margin: 0; }
.print-area.pr-printing .pr-head { flex-direction: row; }
.print-area.pr-printing .pr-kpis { grid-template-columns: repeat(3, 1fr); }
.print-area.pr-printing .pr-two { grid-template-columns: 1.25fr 1fr; }

/* Initiatives table: the topic gets the room */
.pr-ini .pr-it { width: 46%; white-space: pre-line; } .pr-ini .pr-ty { white-space: nowrap; }
.pr-two { grid-template-columns: 1.6fr 1fr; }

/* Guests tab: Top guests (compact) on the left, How guests join on the right */
@media (min-width: 1100px) { .gs-grid.gs-two { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); } }
.gs-compact .gs-tbl td { padding: 5px 8px; } .gs-compact .gs-tbl th { padding: 5px 8px; }
@media (max-width: 1399px) { .gs-join { grid-template-columns: minmax(0, 1fr) !important; } .gs-join-col + .gs-join-col { border-left: 0 !important; padding-left: 0 !important; } }

/* the two cards of a row have the same height */
.gs-grid, .gs-grid.gs-two { align-items: stretch; }
.gs-grid > .card { margin-bottom: 0; }
