:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --panel-warm: #fffdf8;
  --text: #1f2937;
  --muted: #667085;
  --line: #d9dee7;
  --line-strong: #b9c1cf;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #e8f5f3;
  --ink: #17213f;
  --warning: #b45309;
  --warning-bg: #fff7ed;
  --purple: #6d28d9;
  --purple-bg: #f5f3ff;
  --rose: #be123c;
  --rose-bg: #fff1f2;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.12);
  --shadow-soft: 0 10px 30px rgba(31, 41, 55, 0.08);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.planning-timing-fields { min-width: 0; margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.planning-timing-fields legend { padding: 0 6px; font-weight: 650; }
.planning-interval-editor { border: 0; margin: 0; padding: 0; min-width: 0; }
.planning-timing-fields [hidden] { display: none !important; }
.planning-interval-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.planning-interval-row label { display: grid; gap: 5px; flex: 1 1 104px; min-width: 0; font-size: 12px; }
.planning-interval-row select, .planning-interval-row input { width: 100%; min-width: 0; padding: 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--text); }
.planning-interval-row .button { flex: 0 0 auto; }
.planning-timing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.planning-rule-targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.planning-time-profiles { display: grid; gap: 20px; margin-top: 20px; }
.planning-time-card { border: 1px solid var(--line); border-radius: 10px; background: white; padding: 18px; }
.planning-time-card header { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.planning-time-card h4 { margin: 0 0 5px; font-size: 16px; }
.planning-time-card header p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.planning-time-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.planning-time-week section > strong { display: block; font-size: 13px; margin: 5px 0 12px; }
.planning-time-slot { padding: 10px; margin: 6px 0; background: var(--accent-soft); border-radius: 6px; font-size: 12px; }
.planning-time-slot b, .planning-time-slot span { display: block; }
.planning-time-slot.is-break { background: var(--warning-bg); }
.planning-time-slot.is-lunch { background: var(--blue-bg); }
@media (max-width: 700px) { .planning-rule-targets { grid-template-columns: 1fr; } .planning-time-week { grid-template-columns: 1fr; } .planning-time-card header { flex-direction: column; } }

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(243, 245, 248, 0) 230px),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

body.is-locked {
  background: #ffffff;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

.access-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    linear-gradient(135deg, rgba(23, 33, 63, 0.06), rgba(15, 118, 110, 0.09)),
    #ffffff;
}

.access-screen[hidden] {
  display: none;
}

.access-panel {
  width: min(100%, 640px);
  display: grid;
  justify-items: center;
  gap: 24px;
  border: 1px solid rgba(217, 222, 231, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 44px);
  text-align: center;
}

.access-logo {
  width: min(100%, 560px);
  max-height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(23, 33, 63, 0.08));
}

.access-panel h1 {
  color: var(--ink);
  font-size: 2rem;
  font-weight: 800;
}

.corporate-access {
  width: min(100%, 390px);
  display: grid;
  gap: 14px;
}

.access-intro {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.google-access-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1rem;
}

.google-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #4285f4;
  font-weight: 900;
}

.privacy-link {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-link:hover {
  color: var(--ink);
}

.privacy-link:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 3px;
  border-radius: 2px;
}

.account-privacy-link {
  border-top: 1px solid var(--line);
  padding: 10px 4px 2px;
  text-align: center;
}

.access-global-error {
  width: min(100%, 390px);
  min-height: 1.35em;
  text-align: center;
}

body.is-locked .app-shell {
  display: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 26px rgba(31, 41, 55, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--ink);
}

.brand-logo {
  width: clamp(172px, 14vw, 220px);
  max-height: 56px;
  object-fit: contain;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-size: 1.42rem;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.05rem;
}

.top-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.top-actions #editModeBtn { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.top-actions #editModeBtn .signed-in-name { font-size: 0.78em; font-weight: 750; }

.account-menu-wrap {
  position: relative;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(390px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
  padding: 12px;
}

.account-menu[hidden] {
  display: none;
}

.view-as-user-controls {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.view-as-user-controls label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.account-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.account-menu-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-tool {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  padding: 9px 11px;
  text-align: left;
}

.account-tool::before {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 900;
}

.account-tool--notifications::before { content: "•"; font-size: 1.45rem; }
.account-tool--export::before { content: "↓"; }
.account-tool--import::before { content: "↑"; }
.account-tool--move::before { content: "↔"; }
.account-tool--undo::before { content: "↶"; }

.account-tool.notifications-button {
  justify-content: flex-start;
}

.account-tool .notification-unread-badge {
  margin-left: auto;
}

.account-summary,
.account-preferences,
.account-sign-out {
  width: 100%;
  justify-content: center;
}

.preferences-account {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.preferences-account strong {
  color: var(--ink);
}

.preferences-account span {
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-preferences {
  display: grid;
  gap: 12px;
}

.calendar-preferences-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.calendar-preferences-head h4,
.calendar-preferences-head p {
  margin: 0;
}

.calendar-preferences-head p,
.calendar-privacy-note,
.calendar-preferences-status {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.calendar-connection-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 800;
}

.calendar-connection-badge.is-connected {
  background: #ecfdf5;
  color: #047857;
}

.calendar-display-toggle,
.calendar-list label {
  display: flex;
  gap: 9px;
  align-items: center;
}

.calendar-display-toggle {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 700;
}

.calendar-list {
  display: grid;
  gap: 7px;
  max-height: 210px;
  overflow: auto;
}

.calendar-list label {
  display: grid !important;
  grid-template-columns: 22px 12px minmax(0, 1fr);
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.calendar-list-color {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--calendar-color, #4f46e5);
}

.calendar-list-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.84rem;
}

.calendar-preferences-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-privacy-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef2ff;
  color: #3730a3;
}

.account-sign-out {
  width: 100%;
}

.user-preview-banner {
  position: sticky;
  top: 93px;
  z-index: 19;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f4c56b;
  background: #fff7df;
  padding: 9px 16px;
  color: #7c4a03;
  font-size: 0.88rem;
  font-weight: 750;
}

.user-preview-banner[hidden] {
  display: none;
}

.filter-stack,
.field {
  display: grid;
  gap: 6px;
}

.filter-stack label,
.field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}


input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

#stageFilter option.stage-option-main {
  color: #0f2d52;
  font-size: 1.03rem;
  font-weight: 800;
}

.is-guards .sidebar > .filter-stack:first-of-type {
  display: none;
}

.guard-stage-inline {
  margin-top: 10px;
  max-width: 220px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  background: white;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.04);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  border-color: var(--line);
}

.button.secondary:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.danger {
  border-color: #fecdd3;
  color: var(--rose);
  background: var(--rose-bg);
}

.button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 16px 24px 12px;
}

.draft-bar {
  margin: 12px 24px 0;
  padding: 11px 14px;
  border: 1px solid #99d8d1;
  border-radius: var(--radius);
  background: #f0fdfa;
  color: #134e4a;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-soft);
}

.draft-bar[hidden] {
  display: none !important;
}

.can-edit-all .draft-bar {
  display: flex;
}

.draft-bar.has-draft {
  border-color: #f4cf67;
  background: #fffbeb;
  color: #713f12;
}

.draft-status,
.draft-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.draft-status > div {
  display: grid;
  gap: 2px;
}

.draft-status span:not(.draft-dot) {
  color: var(--muted);
  font-size: 0.82rem;
}

.draft-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
}

.has-draft .draft-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.draft-comparison {
  display: grid;
  gap: 14px;
  max-height: min(620px, calc(100dvh - 190px));
  overflow: auto;
  padding-right: 4px;
}

.draft-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.draft-metric,
.draft-audit-box,
.draft-table-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 11px 12px;
}

.draft-metric {
  display: grid;
  gap: 3px;
  text-align: center;
}

.draft-metric strong {
  color: var(--ink);
  font-size: 1.25rem;
}

.draft-metric span,
.draft-audit-box p {
  color: var(--muted);
  font-size: 0.8rem;
}

.draft-audit-box.is-blocked {
  border-color: #fda4af;
  background: #fff1f2;
}

.draft-audit-box.is-clear {
  border-color: #86efac;
  background: #f0fdf4;
}

.draft-audit-box h4,
.draft-audit-box p,
.draft-table-summary h4 {
  margin: 0;
}

.draft-audit-box ul,
.draft-table-summary ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.draft-table-summary li + li,
.draft-audit-box li + li {
  margin-top: 5px;
}

.summary-strip[hidden] {
  display: none;
}

#metricRow { display: none !important; }
#resetBtn { display: none !important; }

.summary-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 13px 14px 13px 16px;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.summary-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.42rem;
}

.summary-card--updated strong {
  white-space: nowrap;
  font-size: 1.18rem;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.summary-dialog-form { width: min(760px, calc(100vw - 32px)); }
.summary-dialog-description { margin: 0; color: var(--muted); font-size: .84rem; }
.summary-modal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.summary-modal-grid .summary-card { min-width: 0; }
.summary-modal-grid .summary-card--updated { grid-column: span 2; }

@media (max-width: 620px) {
  .summary-modal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-modal-grid .summary-card--updated { grid-column: 1 / -1; }
}

.view-tabs {
  position: relative;
  z-index: 60;
  display: flex;
  gap: 8px;
  margin: 14px 24px 16px;
  width: fit-content;
  max-width: calc(100% - 48px);
  border: 1px solid rgba(185, 193, 207, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.07);
  padding: 6px;
  overflow: visible;
  backdrop-filter: blur(14px);
}

.topbar .view-tabs {
  align-self: center;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  box-shadow: 0 7px 22px rgba(31, 41, 55, 0.06);
}

.view-tabs > .tab-button {
  position: relative;
}

.view-tabs > * + * {
  margin-left: 10px;
}

.view-tabs > * + *::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -10px;
  width: 1px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(102, 112, 133, 0.32) 22%, rgba(102, 112, 133, 0.32) 78%, transparent);
  transform: translateY(-50%);
  pointer-events: none;
}

.view-menu {
  position: relative;
  flex: 0 0 auto;
}

.view-menu-trigger {
  display: inline-flex;
  gap: 0;
  align-items: center;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.view-menu-trigger:hover {
  border-color: rgba(15, 118, 110, 0.2);
  background: #f4faf9;
  transform: translateY(-1px);
}

.view-menu-trigger.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #0f766e, #0b8278);
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.23);
}

.view-menu-primary {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.view-menu-toggle {
  align-self: stretch;
  border: 0;
  border-left: 1px solid rgba(102, 112, 133, 0.18);
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  color: #667085;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.view-menu-toggle:hover {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.08);
}

.view-menu-toggle.is-active {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.view-menu-toggle span {
  display: inline-block;
  color: currentColor;
  font-size: 0.82rem;
  transition: transform 0.16s ease;
}

.view-menu.is-open .view-menu-toggle span {
  transform: rotate(180deg);
}

.guard-availability-stage + .guard-availability-stage {
  margin-top: 24px;
}

.guard-availability-stage > h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1rem;
}

.view-menu-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0;
  display: none;
  min-width: 230px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.17);
  padding: 6px;
}

.view-menu.is-open .view-menu-popover {
  z-index: 80;
  display: grid;
  gap: 2px;
}

.view-menu:last-child .view-menu-popover {
  right: 0;
  left: auto;
}

.view-menu-item {
  display: flex;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  padding: 9px 11px;
  color: #344054;
  font-weight: 750;
  text-align: left;
}

.view-menu-item:hover,
.view-menu-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.view-menu-item small {
  min-width: 26px;
  border-radius: 999px;
  background: #eef2f6;
  padding: 2px 7px;
  color: #667085;
  font-size: 0.72rem;
  text-align: center;
}

.tab-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  padding: 10px 14px;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  color: #344054;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab-button:hover {
  border-color: rgba(15, 118, 110, 0.2);
  background: #f4faf9;
  transform: translateY(-1px);
}

.tab-button.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #0f766e, #0b8278);
  color: white;
  box-shadow: 0 7px 16px rgba(15, 118, 110, 0.23);
}

.view-menu-primary:hover,
.view-menu-primary.is-active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label {
  line-height: 1;
}

.nav-count {
  min-width: 25px;
  border-radius: 999px;
  background: #edf2f7;
  padding: 3px 7px;
  color: #667085;
  font-size: 0.72rem;
  line-height: 1;
  text-align: center;
}

.tab-button.is-active .nav-count {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.workspace {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  width: 100%;
  min-height: 0;
  padding: 24px;
}

.sidebar-toggle {
  position: absolute;
  z-index: 12;
  top: 36px;
  left: 274px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #b9ddd8;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.12);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: left 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sidebar-toggle:hover {
  background: #d8efec;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.18);
  transform: translateY(-1px);
}

.sidebar-toggle:active {
  transform: translateY(0);
}

.workspace.is-sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
.workspace.is-sidebar-collapsed .sidebar { display: none; }
.workspace.is-sidebar-collapsed .sidebar-toggle { top: 34px; left: 34px; border-radius: 10px; }
.workspace.is-sidebar-collapsed .main-panel { grid-column: 1; }

.sidebar,
.main-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.sidebar > .filter-stack:first-of-type {
  padding-right: 44px;
}

.entity-list {
  display: grid;
  gap: 7px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.entity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: stretch;
}

.entity-add-button {
  display: none;
  width: 34px;
  min-width: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.entity-add-button:hover {
  border-color: rgba(15, 118, 110, 0.45);
  background: #edf7f5;
}

.entity-row:has(.entity-button[data-entity]) .entity-add-button {
  display: block;
}

.entity-button {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 10px;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.entity-button:hover,
.entity-button.is-active {
  border-color: rgba(15, 118, 110, 0.45);
  background: #edf7f5;
}

.entity-button.is-active {
  box-shadow: inset 4px 0 0 var(--accent);
}

.entity-button strong {
  display: block;
  overflow-wrap: anywhere;
}

.entity-button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.auxiliary-load-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 130px;
}

.auxiliary-load-identity small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.entity-button .entity-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.entity-button:has(.entity-check) {
  padding-right: 38px;
}

.schedule-stack {
  display: grid;
  gap: 18px;
}

.schedule-block {
  display: grid;
  gap: 8px;
}

.schedule-block h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
}

.schedule-grid-embedded {
  min-width: 760px;
}

.main-panel {
  min-width: 0;
  min-height: 100%;
  padding: 18px;
}

.panel-head {
  display: flex;
  gap: 14px;
  align-items: start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin: -2px -2px 10px;
  padding: 2px 2px 10px;
}

.panel-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.panel-tools > [hidden] {
  display: none !important;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.metric-row[hidden] {
  display: none;
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
  padding: 8px 10px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.schedule-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  scrollbar-width: thin;
}

.schedule-grid {
  display: grid;
  grid-template-columns: minmax(68px, 0.42fr) repeat(5, minmax(112px, 1fr));
  min-width: 760px;
}

.duty-plan-sidebar-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #bfd7dc;
  border-radius: 14px;
  background: linear-gradient(145deg, #f4fbfc, #edf6f8);
  color: var(--ink);
}

.duty-plan-sidebar-card strong { font-size: 1rem; }
.duty-plan-sidebar-card span,
.duty-plan-sidebar-card small { color: var(--muted); line-height: 1.35; }
.duty-plan-cell { min-height: 86px; padding: 5px; }
.duty-plan-time { justify-content: center; }
.duty-plan-time strong { color: var(--ink); font-size: .76rem; }
.duty-plan-time span { color: #54717a; font-size: .65rem; }

.duty-plan-card {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 5px;
  align-content: center;
  justify-items: center;
  padding: 8px;
  border: 1px solid #b9d8dd;
  border-radius: 10px;
  background: #edf8fa;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.duty-plan-card[class*="duty-plan-card--patio"] { min-height: 158px; border-color: #efd19d; background: #fff8e9; }
.duty-plan-card--guardia .duty-plan-people { display: grid; place-items: center; gap: 7px; }
.duty-plan-card--guardia .duty-plan-person { padding: 0; border-radius: 0; background: transparent; font-size: .86rem; line-height: 1.2; text-align: center; }
.duty-plan-card:hover { border-color: var(--accent); box-shadow: 0 3px 10px rgba(25, 85, 97, .12); }
.duty-plan-kind { color: #356a75; font-size: .64rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.duty-plan-assignment-head { width: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; padding: 0 6px 3px; color: #8a4b08; font-size: .58rem; font-weight: 850; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.duty-plan-people { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.duty-plan-person { padding: 3px 7px; border-radius: 999px; background: rgba(255, 255, 255, .92); font-size: .69rem; line-height: 1.15; }
.duty-plan-person strong { font: inherit; font-weight: 780; }
.duty-plan-person small { color: #8a4b08; font-size: .64rem; font-weight: 760; }
.duty-plan-person--auxiliary { background: #f3e8ff; box-shadow: inset 0 0 0 1px #c4b5fd; }
.duty-plan-person--auxiliary strong { color: #5b21b6; }
.duty-plan-person--auxiliary small { color: #6d28d9; }
.duty-plan-card--guardia .duty-plan-person--auxiliary { padding: 4px 9px; border-radius: 999px; background: #f3e8ff; box-shadow: inset 0 0 0 1px #c4b5fd; }
.duty-plan-people--zoned { display: grid; gap: 0; border: 1px solid rgba(196, 142, 61, .22); border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, .72); }
.duty-plan-people--zoned .duty-plan-person { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 6px; border-radius: 0; background: transparent; text-align: left; }
.duty-plan-people--zoned .duty-plan-person--auxiliary { background: #f3e8ff; box-shadow: inset 3px 0 0 #8b5cf6; }
.duty-plan-people--zoned .duty-plan-person + .duty-plan-person { border-top: 1px solid rgba(196, 142, 61, .18); }
.duty-plan-edit { justify-self: center; color: var(--accent); font-size: .64rem; font-weight: 800; }
.duty-plan-empty { padding: 28px; color: var(--muted); }

.duty-plan-boards { display: grid; gap: 22px; padding: 14px; background: #f7fafb; }
.duty-plan-board { min-width: 0; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 5px 18px rgba(31, 41, 55, .06); scrollbar-width: thin; }
.duty-plan-board-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #f7fafb; }
.duty-plan-board-head h3 { margin: 0; font-size: 1.05rem; }
.duty-plan-board-head p { margin: 3px 0 0; color: var(--muted); font-size: .75rem; }
.duty-plan-board-head > strong { color: #356a75; font-size: .75rem; white-space: nowrap; }
.duty-plan-grid { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
.duty-plan-zone-grid .grid-cell { min-height: 44px; border-right: 1px solid #e5eaee; }
.duty-plan-zone-grid .grid-cell:nth-child(6n) { border-right: 1px solid #e5eaee; }
.duty-plan-zone-grid .duty-plan-zone-last-day { border-right: 0; }
.duty-plan-zone-grid .time-head,
.duty-plan-zone-grid .day-head { min-height: 42px; }
.duty-plan-zone-head,
.duty-plan-zone-cell { background: #fff8e9; color: #8a4b08; }
.duty-plan-zone-cell { display: flex; align-items: center; justify-content: center; padding: 5px 8px; font-size: .72rem; font-weight: 820; line-height: 1.14; text-align: center; }
.duty-plan-matrix-time { align-items: center; justify-content: center; padding: 6px; text-align: center; }
.duty-plan-zone-assignment-cell { padding: 0; background: #ffffff; }
.duty-plan-service--morning { --duty-service-strong: #e3f1ff; --duty-service-soft: #f4f9ff; --duty-service-text: #18537b; }
.duty-plan-service--afternoon-1 { --duty-service-strong: #e7f5e4; --duty-service-soft: #f5fbf3; --duty-service-text: #286128; }
.duty-plan-service--afternoon-2 { --duty-service-strong: #eee7fb; --duty-service-soft: #faf7ff; --duty-service-text: #5b3b88; }
.duty-plan-service--afternoon-other { --duty-service-strong: #fff0d8; --duty-service-soft: #fff9ef; --duty-service-text: #8a4b08; }
.duty-plan-service--dining { --duty-service-strong: #ffe8df; --duty-service-soft: #fff7f3; --duty-service-text: #8c3f24; }
.duty-plan-service--other { --duty-service-strong: #eef2f6; --duty-service-soft: #f8fafc; --duty-service-text: #334155; }
.duty-plan-zone-cell.duty-plan-service-tone,
.duty-plan-matrix-time.duty-plan-service-tone { background: var(--duty-service-strong); color: var(--duty-service-text); }
.duty-plan-zone-assignment-cell.duty-plan-service-tone { background: var(--duty-service-soft); }
.duty-plan-zone-assignment { width: 100%; min-height: 44px; height: 100%; display: grid; place-items: center; gap: 2px; padding: 5px 7px; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: center; }
.duty-plan-zone-assignment strong { font-size: .72rem; line-height: 1.12; }
.duty-plan-zone-teacher { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; padding: 2px 6px; border-radius: 999px; }
.duty-plan-zone-teacher--auxiliary { background: #f3e8ff; color: #5b21b6; box-shadow: inset 0 0 0 1px #c4b5fd; }
.duty-plan-zone-assignment:hover { background: #edf8fa; box-shadow: inset 0 0 0 1px #90c8cf; }
.duty-plan-card.is-duty-editable,
.duty-plan-zone-assignment.is-duty-editable { position: relative; }

.duty-plan-board-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.duty-plan-edit-access { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid #9bcfc9; border-radius: 999px; background: #e9f7f5; color: #11635e; font-size: .68rem; font-weight: 850; white-space: nowrap; }

.duty-record-editor { display: grid; gap: 16px; min-width: min(720px, 78vw); }
.duty-record-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.duty-record-summary > div {
  display: grid;
  gap: 4px;
  border: 1px solid #dce6ea;
  border-radius: 10px;
  background: #f7fafb;
  padding: 9px 11px;
}
.duty-record-summary span,
.duty-assignment-zone span,
.duty-assignment-person > span { color: var(--muted); font-size: .67rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.duty-record-summary strong { font-size: .85rem; }
.duty-assignment-editor-list { display: grid; gap: 8px; }
.duty-assignment-editor-row {
  display: grid;
  grid-template-columns: minmax(110px, .36fr) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid #dce6ea;
  border-radius: 12px;
  background: white;
  padding: 11px;
}
.duty-assignment-editor-row.is-selected-zone { border-color: #53aaa5; box-shadow: 0 0 0 3px rgba(21, 125, 118, .1); }
.duty-assignment-zone,
.duty-assignment-person { display: grid; gap: 5px; }
.duty-assignment-zone strong { font-size: .84rem; }
.duty-assignment-zone input { width: 100%; min-width: 0; }
.duty-assignment-person select { width: 100%; min-width: 0; }
.duty-assignment-person > strong { min-height: 42px; display: flex; align-items: center; }
.duty-assignment-person small { color: var(--muted); }
.duty-assignment-remove {
  align-self: end;
  min-height: 42px;
  border: 1px solid #efc7c7;
  border-radius: 9px;
  background: #fff7f7;
  color: #a62828;
  padding: 0 12px;
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}
.duty-assignment-remove:hover { background: #ffeded; }
.duty-assignment-add { justify-self: start; }
.duty-assignment-empty {
  border: 1px dashed #b9c8ce;
  border-radius: 10px;
  background: #f8fafb;
  padding: 13px;
  color: var(--muted);
  font-size: .8rem;
}
.duty-plan-zone-empty,
.duty-plan-person--empty strong { color: #657786; font-size: .74rem; font-weight: 750; }
.duty-editor-safety { margin: 0; border-left: 4px solid var(--accent); border-radius: 8px; background: #edf8f6; padding: 10px 12px; color: #315f5b; font-size: .76rem; line-height: 1.45; }

@media (max-width: 760px) {
  .duty-record-editor { min-width: 0; }
  .duty-record-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duty-assignment-editor-row { grid-template-columns: 1fr; align-items: stretch; }
}

.grid-cell {
  min-height: 38px;
  border-right: 1px solid #e5eaee;
  border-bottom: 1px solid #e5eaee;
  padding: 5px;
}

.grid-cell.is-alternate-row:not(.is-break-module) {
  background: #f8fafb;
}

.grid-cell:not(.day-head):not(.time-head):hover {
  background-color: #fbfdfd;
}

.grid-cell.is-break-module {
  background: #fff8ed;
  min-height: 20px;
  padding-block: 1px;
}

.grid-cell:nth-child(6n) {
  border-right: 0;
}

.day-head,
.time-head {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: auto;
  background: #eef3f7;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.day-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 750;
}

.time-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: start;
  background: #fbfcfd;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.68rem;
  line-height: 1.15;
  box-shadow: 1px 0 0 var(--line);
}

.time-cell.is-break-module {
  background: #fff3df;
  color: #92400e;
  justify-content: center;
}

.empty-slot {
  display: none;
  width: 100%;
  min-height: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.16s ease, background-color 0.16s ease;
}

.can-edit-all .empty-slot,
.can-edit-guards.is-guards .empty-slot {
  display: block;
}

.grid-cell:hover .empty-slot,
.empty-slot:focus-visible {
  background: rgba(255, 255, 255, 0.72);
  opacity: 0.78;
}

@media (hover: none) {
  .can-edit-all .empty-slot,
  .can-edit-guards.is-guards .empty-slot {
    opacity: 0.45;
  }
}

.event-stack {
  display: grid;
  gap: 5px;
}

.event-card {
  --event-accent: var(--accent);
  --event-bg: #eef8f7;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--event-accent);
  border-radius: 10px;
  background: var(--event-bg);
  padding: 5px 7px;
  align-content: center;
  justify-items: center;
  text-align: center;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(31, 41, 55, 0.07);
  transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.event-card:hover {
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.12);
  transform: translateY(-1px);
}

.event-card strong {
  width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
  line-height: 1.18;
  text-align: center;
}

.event-card span {
  width: 100%;
  overflow-wrap: anywhere;
  color: #5f6b7a;
  font-size: 0.63rem;
  line-height: 1.2;
  text-align: center;
}

.event-card .event-actual-time {
  font-weight: 700;
  color: var(--ink, #1c2849);
  font-variant-numeric: tabular-nums;
}

.event-card .badge-row {
  justify-content: center;
}

.event-card[data-special="reunion"] {
  --event-accent: var(--warning);
  --event-bg: var(--warning-bg);
}

.event-card[data-special="tutoria"] {
  --event-accent: var(--purple);
  --event-bg: var(--purple-bg);
}

.event-card[data-special="familias"] {
  --event-accent: var(--rose);
  --event-bg: var(--rose-bg);
}

.event-card[data-special="guardia"] {
  --event-accent: var(--blue);
  --event-bg: #ffffff;
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  background: #ffffff;
  text-align: center;
}

.event-card[data-special="guardia"] strong {
  width: 100%;
  color: var(--blue);
  font-size: 0.84rem;
  line-height: 1;
  letter-spacing: 0.035em;
  text-align: center;
}

.event-card[data-special="patio"] {
  --event-accent: #d97706;
  --event-bg: #fff7e6;
}

.event-card[data-special="comedor"] {
  --event-accent: #0f766e;
  --event-bg: #ecfdf5;
}

.event-card[data-special="reserva"] {
  --event-accent: #1d4ed8;
  --event-bg: #eff6ff;
}

.event-card[data-special="actividad"] {
  --event-accent: #047857;
  --event-bg: #ecfdf5;
}

.event-card[data-importance="primary"] {
  align-content: center;
  border-color: color-mix(in srgb, var(--event-accent) 28%, #d8e0ea);
  background: var(--event-bg);
  box-shadow: 0 2px 5px rgba(30, 41, 59, 0.11);
}

.event-card[data-importance="primary"] strong {
  color: #17213f;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.08;
}

.event-card[data-importance="primary"] span {
  color: #45546a;
  font-size: 0.62rem;
}

.event-card[data-importance="secondary"] {
  --event-accent: #d2a900;
  --event-bg: #fff4b8;
  min-height: 34px;
  align-content: center;
  border-color: #ead88a;
  border-left-width: 4px;
  background: var(--event-bg);
  padding: 3px 5px;
  box-shadow: 0 1px 2px rgba(120, 53, 15, 0.06);
}

.event-card[data-importance="secondary"] strong {
  color: #7f1d1d;
  font-size: 0.69rem;
  font-weight: 800;
  line-height: 1.1;
}

.event-card[data-importance="secondary"] span {
  color: #725b16;
  font-size: 0.58rem;
}

.event-card[data-importance="secondary"][data-meeting-kind="department"] {
  --event-accent: #4f6f8f;
  --event-bg: #fff4b8;
  border-color: #d7c777;
  background: var(--event-bg);
}

.event-card[data-importance="secondary"][data-meeting-kind="department"] strong {
  color: #7f1d1d;
}

.event-card[data-importance="secondary"][data-meeting-kind="department"] span {
  color: #725b16;
}

.event-card[data-importance="secondary"][data-week="a"] {
  --event-accent: #2563eb;
  --event-bg: #e8f3ff;
  border-color: #b9d7f8;
  background: var(--event-bg);
}

.event-card[data-importance="secondary"][data-week="a"] span {
  color: #315b88;
}

.event-card[data-importance="secondary"][data-week="b"] {
  --event-accent: #7c3aed;
  --event-bg: #f1eafa;
  border-color: #d8c4ee;
  background: var(--event-bg);
}

.event-card[data-importance="secondary"][data-week="b"] span {
  color: #5b3b7d;
}

.event-card[data-importance="tertiary"] {
  --event-accent: #a9b4c2;
  --event-bg: #f8fafc;
  min-height: 30px;
  align-content: center;
  border-color: #e2e8f0;
  border-left-width: 3px;
  background: var(--event-bg);
  padding: 2px 4px;
  color: #64748b;
  box-shadow: none;
}

.event-card[data-importance="tertiary"] strong {
  color: #64748b;
  font-size: 0.63rem;
  font-weight: 700;
  line-height: 1.12;
}

.event-card[data-activity-kind="personal"] strong {
  color: #1e3a5f;
  opacity: 1;
}

.event-card.is-personal-calendar {
  --event-accent: #4f46e5;
  --event-bg: #eef2ff;
  border-color: #c7d2fe;
  border-left-color: #4f46e5;
  background: #eef2ff;
}

.event-card.is-personal-calendar strong {
  color: #312e81;
}

.event-card.is-personal-calendar span,
.event-card.is-personal-calendar .badge {
  color: #4f46e5;
}

.event-card[data-activity-kind="duty"] strong {
  color: #166534;
  opacity: 1;
}

.event-card[data-importance="tertiary"] span {
  color: #94a3b8;
  font-size: 0.54rem;
}

.event-card[data-importance="tertiary"] .badge {
  border: 1px solid #e8edf3;
  background: rgba(255, 255, 255, 0.58);
  color: #8793a4;
  font-size: 0.51rem;
  font-weight: 700;
}

.event-card[data-importance="secondary"]:hover {
  box-shadow: 0 4px 12px rgba(120, 53, 15, 0.1);
}

.event-card[data-importance="tertiary"]:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 7px rgba(71, 85, 105, 0.08);
  transform: none;
}

.event-card[data-special="guardia"][data-importance="tertiary"] {
  --event-accent: #a9b4c2;
  min-height: 30px;
  border-color: #e2e8f0;
  border-left-width: 3px;
  padding: 2px 4px;
}

.event-card[data-special="guardia"][data-importance="tertiary"] strong {
  color: #166534;
  font-size: 0.63rem;
  font-weight: 700;
}

/* Guardias, patios y comedores usan el mismo tratamiento visual en todas las etapas. */
.event-card.is-duty-assignment,
.event-card.is-duty-assignment.is-offstage-event {
  --event-accent: #a9b4c2;
  --event-bg: #f8fafc;
  min-height: 30px;
  border-color: #e2e8f0;
  border-left: 3px solid #a9b4c2;
  background: #f8fafc;
  padding: 2px 4px;
  color: #64748b;
  box-shadow: none;
}

.event-card.is-duty-assignment strong,
.event-card.is-duty-assignment.is-offstage-event strong {
  color: #166534;
  font-size: 0.63rem;
  font-weight: 700;
  line-height: 1.12;
}

.event-card.is-duty-assignment span,
.event-card.is-duty-assignment.is-offstage-event span {
  color: #94a3b8;
  font-size: 0.54rem;
}

.event-card.is-offstage-event {
  border-width: 1px;
  border-left-width: 5px;
  border-color: color-mix(in srgb, var(--event-accent) 32%, white);
  border-left-color: var(--event-accent);
  background: var(--event-bg);
}

.event-card.is-offstage-event strong {
  color: color-mix(in srgb, var(--event-accent) 78%, #17213f);
}

.event-card.is-offstage-infantil {
  --event-accent: #0f766e;
  --event-bg: #dff5f1;
}

.event-card.is-offstage-primaria {
  --event-accent: #2563eb;
  --event-bg: #e7f0ff;
}

.event-card.is-offstage-secundaria {
  --event-accent: #7c3aed;
  --event-bg: #f0eaff;
}

.event-card.is-offstage-centro {
  --event-accent: #b45309;
  --event-bg: #fff1dc;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 1px 5px;
  color: #344054;
  font-size: 0.58rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.04);
}

.details-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.is-reservation-hub .workspace { grid-template-columns: minmax(0, 1fr); }
.is-reservation-hub .sidebar,
.is-reservation-hub .sidebar-toggle,
.is-reservation-hub .schedule-wrap,
.is-reservation-hub .panel-tools { display: none; }
.is-reservation-hub .main-panel { grid-column: 1; }
.reservation-hub { display: grid; gap: 24px; }
.reservation-hub-own { border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.reservation-hub-own-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.reservation-hub-own-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #f8fafc; display: grid; gap: 16px; }
.reservation-hub-own-card p { margin: 8px 0; }
.reservation-hub-own-info { min-width: 0; overflow-wrap: anywhere; }
.reservation-hub-own-info h4 { font-size: 1.1rem; }
.reservation-hub-own-occurrence { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.reservation-hub-own-date { flex: 1 1 180px; min-width: 0; }
.reservation-hub-own-occurrence .room-reservation-actions { flex: 0 0 auto; }
.reservation-hub h3, .reservation-hub h4 { margin: 0 0 12px; }
.reservation-hub-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.reservation-hub-permanent { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f8fafc; }
.reservation-hub-permanent input { width: auto; min-height: auto; margin-right: 8px; accent-color: #0f766e; }
.reservation-hub-results { display: grid; gap: 16px; }
.reservation-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.reservation-hub-room { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line, #d5dde2); border-radius: 14px; background: var(--surface, #fff); color: var(--ink, #182d40); text-align: left; cursor: pointer; font: inherit; }
.reservation-hub-room span { color: #246044; font-size: .85rem; }
.reservation-hub-room:hover, .reservation-hub-room.is-selected { border-color: #27795a; background: #eef8f2; }
.reservation-hub-room.is-selected { box-shadow: inset 0 0 0 1px #27795a; }
.reservation-hub-room:focus-visible { outline: 3px solid #27795a; outline-offset: 3px; }
.reservation-hub-confirm, .reservation-hub-upcoming { border-top: 1px solid var(--line, #d5dde2); padding-top: 20px; }
@media (max-width: 600px) { .reservation-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .reservation-hub-room { padding: 12px; overflow-wrap: anywhere; } .reservation-hub .room-reservations-head { flex-wrap: wrap; } }

.details-panel:empty {
  display: none;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
  padding: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.detail-grid div {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.guard-cell {
  min-height: 116px;
  background: #fcfcfd;
}

.guard-cell.has-absence {
  background: #fff7f7;
}

.guard-slot-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 7px;
}

.guard-slot-head strong {
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.guard-slot-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.teacher-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 118px;
  overflow: auto;
}

.teacher-chip {
  display: inline-grid;
  gap: 1px;
  max-width: 100%;
  border: 1px solid #cfe2df;
  border-radius: 8px;
  background: #eef8f7;
  color: var(--accent-strong);
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: left;
  overflow-wrap: anywhere;
}

.teacher-chip small {
  color: #526177;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
}

.teacher-chip.is-contextual {
  border-color: #d6ddeb;
  background: #f6f8fb;
  color: #0f2d52;
}

.teacher-chip:hover {
  border-color: var(--accent);
  background: #dff1ee;
}

.muted-chip {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.guard-absence-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.guard-absence {
  border: 1px solid #fecdd3;
  border-left: 5px solid var(--rose);
  border-radius: var(--radius);
  background: var(--rose-bg);
  padding: 7px;
}

.guard-absence strong,
.guard-absence span {
  display: block;
  overflow-wrap: anywhere;
}

.guard-absence strong {
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 800;
}

.guard-absence span {
  margin-top: 2px;
  color: #7f1d1d;
  font-size: 0.75rem;
  line-height: 1.35;
}

.guard-absence.is-draft {
  border-style: dashed;
}

.guard-planner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
}

.guard-form,
.guard-list,
.guard-record {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
  padding: 13px;
}

.guard-form h3,
.guard-list h3 {
  margin-bottom: 12px;
}

.guard-flow-note {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 10px;
}

.hour-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.hour-option {
  display: grid;
  grid-template-columns: auto 88px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 9px;
}

.hour-option.is-selected {
  border-color: rgba(15, 118, 110, 0.45);
  background: #edf7f5;
}

.hour-option.is-disabled {
  opacity: 0.56;
}

.hour-option input {
  width: auto;
  margin-top: 2px;
}

.hour-option strong {
  font-size: 0.84rem;
}

.hour-option span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.substitution-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.substitution-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.65fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 9px;
}

.substitution-row strong,
.substitution-row span {
  display: block;
}

.manual-substitute-field {
  display: grid;
  gap: 5px;
}

.manual-substitute-field span {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.substitution-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.substitution-row select option:disabled,
.substitution-row select .substitute-option--absent {
  color: #aeb7c4;
  background: #f4f6f8;
}

.teacher-chip.is-unavailable,
.teacher-chip:disabled {
  color: #aeb7c4;
  background: #f4f6f8;
  border-color: #dfe4ea;
  cursor: not-allowed;
}

.guard-actions,
.guard-record-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.guard-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.guard-export-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 10px;
}

.guard-export-panel .button {
  display: grid;
  width: 100%;
  height: 60px;
  min-height: 60px;
  place-items: center;
}

.guard-export-panel .field,
.guard-export-panel input,
.guard-export-panel select {
  min-width: 0;
}

.guard-export-panel input[type="date"] {
  position: relative;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231f2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18'/%3E%3C/svg%3E");
  background-position: right 11px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  cursor: pointer;
}

.guard-export-panel input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.guard-download-label {
  display: grid;
  gap: 3px;
  line-height: 1.05;
  text-align: center;
}

.guard-download-label span:last-child {
  font-size: 0.88em;
}

.guard-availability-section {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 13px;
}

.guard-availability-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.guard-availability-head h3 {
  margin: 0;
}

.guard-availability-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.guard-availability-wrap {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  scrollbar-width: thin;
}

.guard-availability-grid {
  display: grid;
}

.guard-record {
  background: white;
}

.guard-record > div:first-child {
  display: grid;
  gap: 3px;
}

.guard-record span {
  color: var(--muted);
  font-size: 0.82rem;
}

.guard-record ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #344054;
  font-size: 0.86rem;
}

.direction-report {
  padding: 12px;
}

.direction-report table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.direction-report tr:hover td {
  background: #fbfdfd;
}

.direction-report th,
.direction-report td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.direction-report th {
  background: #eef3f7;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.teacher-load-report .numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.teacher-load-explanation {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.teacher-load-report th {
  white-space: nowrap;
}

.schedule-wrap:has(.teacher-load-report) {
  max-height: calc(100dvh - 240px);
  overscroll-behavior: contain;
}

.teacher-load-report thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  box-shadow: inset 0 -2px 0 #cbd5e1;
}

.teacher-load-report thead th:first-child,
.teacher-load-report tbody tr:not(.teacher-load-stage-row) > td:first-child {
  position: sticky;
  left: 0;
  min-width: 180px;
}

.teacher-load-report thead th:first-child {
  z-index: 10;
  background: #eef3f7;
  box-shadow: inset 0 -2px 0 #cbd5e1, inset -2px 0 0 #cbd5e1;
}

.teacher-load-report tbody tr:not(.teacher-load-stage-row) > td:first-child {
  z-index: 4;
  background: white;
  box-shadow: inset -2px 0 0 #e2e8f0;
}

.teacher-load-report tr:hover > td:first-child {
  background: #fbfdfd;
}

.teacher-load-report .load-detail-cell {
  min-width: 190px;
  font-variant-numeric: tabular-nums;
}

.teacher-load-report .load-detail-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.teacher-load-report .load-class-cell,
.teacher-load-report .load-meeting-cell,
.teacher-load-report .load-personal-cell {
  min-width: 260px;
  vertical-align: top;
}

.teacher-load-report .load-detail-total {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.teacher-load-report .load-detail-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  list-style: none;
}

.teacher-load-report .load-detail-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding-left: 10px;
  position: relative;
}

.teacher-load-report .load-detail-list li::before {
  position: absolute;
  left: 0;
  color: var(--accent);
  content: "•";
}

.teacher-load-report .load-detail-list strong {
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-size: inherit;
  white-space: nowrap;
}

.teacher-load-report .load-detail-empty {
  color: var(--muted);
}

.responsibility-line {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 58px auto auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
}

.responsibility-line:last-child {
  margin-bottom: 0;
}

.responsibility-line input,
.workload-percent input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 5px 6px;
}

.responsibility-save,
.responsibility-delete {
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.responsibility-save:hover {
  border-color: rgba(15, 118, 110, 0.5);
  background: #edf7f5;
}

.responsibility-delete {
  color: #b42318;
}

.responsibility-delete:hover {
  border-color: #f5b5af;
  background: #fff1f0;
}

.workload-percent {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.teacher-load-hours-editor {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.teacher-load-hours-editor input {
  width: 62px;
  min-width: 0;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 5px 6px;
  text-align: right;
}

.workload-percent input {
  width: 64px;
  text-align: right;
}

.teacher-load-report .load-negative {
  color: #067647;
}

.teacher-load-report .load-positive {
  color: #b42318;
}

.teacher-load-report .teacher-load-stage-row th {
  background: #dcebea;
  color: #115e59;
  font-size: 0.84rem;
  text-align: left;
}

.teacher-load-report .teacher-load-total-row td {
  background: #f3f6f8;
  border-top: 2px solid #94a3b8;
  color: var(--ink);
  font-weight: 800;
}

.teacher-load-report .teacher-load-total-row > td:first-child {
  background: #f3f6f8;
}

.direction-controls.teacher-load-controls {
  grid-template-columns: minmax(0, 1fr);
}

.teacher-load-controls .direction-actions {
  justify-content: flex-start;
}

.responsibility-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) minmax(100px, 0.55fr) minmax(180px, 0.8fr);
  gap: 10px;
  width: 100%;
  min-width: 0;
  align-items: end;
}

.responsibility-form .field {
  min-width: 0;
  margin: 0;
}

.responsibility-form .button {
  width: 100%;
  min-height: 42px;
  white-space: normal;
}

.direction-controls,
.planner-controls,
.substitution-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 13px;
}

.direction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  justify-content: flex-end;
}

.substitution-controls .direction-actions {
  grid-column: 1 / -1;
}

.teacher-multi-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 2px;
}

.teacher-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 800;
}

.teacher-check:has(input:checked) {
  border-color: var(--accent);
  background: #eef8f7;
  color: var(--accent-strong);
}

.teacher-check span {
  min-width: 0;
  color: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: none;
  overflow-wrap: anywhere;
}

.substitution-type-list {
  max-height: 170px;
}

.planner-hint {
  align-self: end;
  font-size: 0.86rem;
}

.planner-sidebar-note {
  display: grid;
  gap: 7px;
  border: 1px solid #cfe2df;
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  background: #eef8f7;
  padding: 13px;
}

.planner-sidebar-note strong {
  color: var(--accent-strong);
}

.planner-sidebar-note span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.planner-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
}

.planner-slot {
  border: 1px solid #cfe2df;
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  background: #eef8f7;
  padding: 12px;
  text-align: left;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.05);
}

.planner-slot strong,
.planner-slot span {
  display: block;
}

.planner-slot strong {
  color: var(--accent-strong);
}

.planner-slot span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.planner-slot.has-adjustment {
  border-color: #fde68a;
  border-left-color: #d97706;
  background: #fffbeb;
}

.planner-slot.has-adjustment strong {
  color: #92400e;
}

.planner-analysis {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  border: 1px solid #dbe4ee;
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 12px 14px;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.4;
}

.planner-analysis strong {
  color: #1e293b;
}

.audit-status-board {
  display: grid;
  gap: 14px;
  padding: 12px;
  background: #f8fafc;
}

.audit-health {
  display: grid;
  gap: 5px;
  border: 1px solid;
  border-left-width: 6px;
  border-radius: var(--radius);
  padding: 14px 16px;
}

.audit-health strong {
  font-size: 1rem;
}

.audit-health span {
  line-height: 1.4;
}

.audit-health.is-blocked {
  border-color: #fecaca;
  border-left-color: #b91c1c;
  background: #fef2f2;
  color: #7f1d1d;
}

.audit-health.is-clear {
  border-color: #bbf7d0;
  border-left-color: #15803d;
  background: #f0fdf4;
  color: #14532d;
}

.audit-exceptions {
  border: 1px solid #bae6d3;
  border-left: 5px solid #15803d;
  border-radius: var(--radius);
  background: #f0fdf4;
  padding: 14px 16px;
}

.audit-exceptions h3 {
  margin: 0 0 8px;
  color: #14532d;
  font-size: 0.98rem;
}

.audit-exceptions ul {
  margin: 0;
  padding-left: 20px;
  color: #365444;
}

.audit-issue-list {
  display: grid;
  gap: 9px;
}

.audit-issue {
  border: 1px solid var(--line);
  border-left: 5px solid #64748b;
  border-radius: var(--radius);
  background: white;
  padding: 12px 14px;
}

.audit-issue--critical { border-left-color: #b91c1c; }
.audit-issue--high { border-left-color: #c2410c; }
.audit-issue--medium { border-left-color: #ca8a04; }
.audit-issue--low { border-left-color: #2563eb; }

.audit-issue-row {
  display: grid;
  grid-template-columns: auto minmax(110px, 170px) minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.audit-issue.is-completed {
  border-color: #bbf7d0;
  border-left-color: #15803d;
  background: #f8fff9;
  opacity: 0.82;
}

.audit-completed-label {
  border-radius: 999px;
  background: #dcfce7;
  padding: 3px 9px;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.audit-severity {
  border-radius: 999px;
  background: #f1f5f9;
  padding: 3px 8px;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.audit-issue-category {
  color: #172033;
  font-size: 0.9rem;
}

.audit-issue p {
  margin: 0;
  color: #334155;
  line-height: 1.4;
}

.audit-issue-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.audit-issue-actions select {
  width: 190px;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: white;
  padding: 6px 9px;
  color: #172033;
  font: inherit;
  font-size: 0.82rem;
}

.audit-priority-save {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.audit-completion-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  min-height: 34px;
  border: 1px solid #15803d;
  border-radius: 9px;
  padding: 6px 10px;
  background: #15803d;
  color: white;
  font-size: 0.78rem;
  font-weight: 850;
  box-shadow: 0 2px 5px rgb(21 128 61 / 18%);
}

.audit-completion-button:hover {
  background: #166534;
}

.audit-completion-button.is-reopen {
  border-color: #94a3b8;
  background: white;
  color: #475569;
  box-shadow: none;
}

.audit-completion-button.is-reopen:hover {
  background: #f1f5f9;
}

.audit-completed-section {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  border-top: 1px solid #cbd5e1;
  padding-top: 16px;
}

.audit-completed-section h3 {
  margin: 0;
  color: #166534;
  font-size: 0.92rem;
}

@media (max-width: 1050px) {
  .audit-issue-row {
    grid-template-columns: auto minmax(110px, 160px) 1fr;
  }

  .audit-issue-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .audit-issue-row {
    grid-template-columns: 1fr;
  }

  .audit-issue-actions {
    grid-column: auto;
    display: grid;
    grid-template-columns: 1fr;
  }

  .audit-issue-actions select,
  .audit-priority-save,
  .audit-completion-button {
    width: 100%;
  }
}

.audit-empty,
.audit-status-note {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 14px;
  color: var(--muted);
}

.wellbeing-intro {
  display: grid;
  gap: 5px;
  border: 1px solid #bae6fd;
  border-left: 5px solid #0369a1;
  border-radius: var(--radius);
  background: #f0f9ff;
  padding: 14px 16px;
  color: #0c4a6e;
}

.wellbeing-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.wellbeing-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.wellbeing-table th,
.wellbeing-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
  white-space: nowrap;
}

.wellbeing-table th:first-child,
.wellbeing-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: white;
  text-align: left;
}

.wellbeing-table thead th {
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.wellbeing-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: #ecfdf5;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 800;
}

.wellbeing-status--vigilar {
  background: #fffbeb;
  color: #92400e;
}

.wellbeing-status--atencion {
  background: #fef2f2;
  color: #991b1b;
}

.audit-history {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
}

.audit-version-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 5px solid #64748b;
  border-radius: var(--radius);
  background: white;
  padding: 14px;
}

.audit-version-card.is-active {
  border-color: #99f6e4;
  border-left-color: var(--accent);
  background: #f0fdfa;
}

.audit-version-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.audit-version-card > div:first-child span {
  border-radius: 999px;
  background: #ccfbf1;
  padding: 3px 8px;
  color: #115e59;
  font-size: 0.72rem;
  font-weight: 900;
}

.audit-version-card small,
.audit-version-card p {
  margin: 0;
  color: var(--muted);
}

.audit-version-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.audit-version-counts span {
  border-radius: 8px;
  background: #f1f5f9;
  padding: 7px 8px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.planning-board {
  display: grid;
  gap: 14px;
  padding: 12px;
}

.planning-board-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.planning-board-head h3 {
  margin: 0 0 4px;
}

.planning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.planning-year-picker {
  display: grid;
  gap: 3px;
  min-width: 150px;
  text-align: left;
}

.planning-year-picker span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.planning-year-picker select {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: white;
  padding: 7px 10px;
  color: var(--ink);
  font-weight: 800;
}

.planning-copy-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  border: 1px solid #bedfd7;
  border-radius: 12px;
  background: #eef8f7;
  padding: 10px 12px;
}

.planning-section-tabs,
.planning-row-actions,
.planning-submit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.planning-section-tabs {
  padding: 4px 0;
}

.planning-structure-tabs {
  padding: 8px 0 2px;
}

.planning-stage-selector {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px 13px;
}

.planning-stage-selector legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 800;
}

.planning-stage-selector > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planning-stage-selector label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  padding: 7px 12px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 750;
  cursor: pointer;
}

.planning-stage-selector label.is-selected,
.planning-stage-selector label:has(input:checked) {
  border-color: #18776f;
  background: #e8f7f4;
  color: #125d57;
}

.planning-stage-selector input {
  width: 16px;
  height: 16px;
  accent-color: #18776f;
}

.planning-stage-selector small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.planning-warning {
  color: #9f2f20 !important;
  font-weight: 750;
}

.feasibility-inline {
  width: fit-content;
  border-radius: 999px;
  background: #eef3f7;
  padding: 3px 8px;
  color: #334155 !important;
  font-weight: 800;
}

.planning-matrix-help {
  display: grid;
  gap: 4px;
  border: 1px solid #bedfd7;
  border-radius: var(--radius);
  background: #eef8f7;
  padding: 13px;
  color: var(--accent-strong);
}

.planning-readiness {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.planning-readiness section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 14px;
}

.planning-readiness h4 {
  margin: 0 0 10px;
}

.planning-readiness ul {
  margin: 0;
  padding-left: 20px;
}

.planning-ok {
  color: var(--accent-strong);
  font-weight: 750;
}

.teaching-matrix {
  min-width: 1100px;
}

.planning-feasibility { display: grid; gap: 6px; border: 1px solid var(--line); border-left: 6px solid #64748b; border-radius: 12px; background: #f8fafc; padding: 12px 14px; }
.planning-feasibility > div { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.planning-feasibility span, .planning-feasibility small { color: var(--muted); }
.planning-feasibility p { margin: 0; font-size: 0.84rem; }
.planning-feasibility.is-viable { border-left-color: #16836f; background: #eef8f7; }
.planning-feasibility.is-limiting { border-left-color: #c17b00; background: #fff8df; }
.planning-feasibility.is-impossible { border-left-color: #b83b2b; background: #fff1ef; }

.planning-empty-state { border: 1px dashed var(--line-strong); border-radius: var(--radius); background: white; padding: 28px; text-align: center; }
.matrix-sheet-wrap { max-height: 72vh; }
.teaching-sheet { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; background: white; font-size: 0.76rem; line-height: 1.15; }
.teaching-sheet th, .teaching-sheet td { min-width: 138px; max-width: 160px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; vertical-align: top; }
.teaching-sheet thead { position: sticky; top: 0; z-index: 10; }
.teaching-sheet thead th { position: sticky; top: 0; z-index: 3; background: #e8eef5; color: var(--ink); white-space: normal; overflow-wrap: anywhere; box-shadow: 0 2px 0 #cbd5e1; }
.teaching-sheet .matrix-total,
.teaching-sheet .matrix-total-head { position: sticky; left: 0; z-index: 3; min-width: 50px; width: 50px; max-width: 50px; text-align: center; }
.teaching-sheet .matrix-total-head { z-index: 5; }
.teaching-sheet .matrix-subject,
.teaching-sheet .matrix-class-head { position: sticky; left: 50px; z-index: 2; min-width: 112px; width: 112px; max-width: 112px; background: #f4f7fa; text-align: left; }
.teaching-sheet .matrix-class-head { z-index: 4; background: #e8eef5; }
.matrix-total { background: #fff3f1; color: #b42318; vertical-align: middle !important; }
.matrix-total.is-complete { background: #e8f7ee; color: #18794e; }
.matrix-total strong, .matrix-total small { display: block; }
.matrix-total strong { font-size: 0.96rem; }
.matrix-total small { margin-top: 1px; font-size: 0.65rem; color: currentColor; }
.matrix-cell { display: grid; gap: 3px; }
.matrix-cell > input,
.matrix-cell > select { width: 100%; min-width: 0; }
.matrix-cell > div { display: grid; grid-template-columns: minmax(48px, 1fr); gap: 3px; }
.matrix-cell input { min-height: 27px; min-width: 0; border: 1px solid #cbd5e1; border-radius: 5px; padding: 3px 5px; font-size: 0.72rem; }
.matrix-cell select { min-height: 58px; border: 1px solid #cbd5e1; border-radius: 5px; padding: 2px; font-size: 0.7rem; }
.matrix-cell.is-saving { opacity: 0.58; }
.matrix-save { border: 0; border-radius: 7px; background: var(--accent); color: white; font-weight: 900; cursor: pointer; }

.planning-subject-band-toolbar { display: grid; gap: 9px; margin: 10px 0; border: 1px solid #cbd5e1; border-radius: 12px; background: #f8fafc; padding: 10px 12px; }
.planning-subject-band-toolbar > div { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.planning-subject-band-toolbar input { min-height: 37px; width: 190px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 9px; }
.planning-subject-band-toolbar input[type="number"] { width: 105px; }
.planning-subject-band-list { padding-top: 2px; }
.subject-band-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid rgba(15, 23, 42, 0.16); border-radius: 999px; padding: 5px 9px; font-size: 0.75rem; font-weight: 800; }
.subject-band-chip button { border: 0; background: transparent; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; }
.shared-group-chip { background: #e7f5ef; color: #145c4c; }
.matrix-subject-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 5px; align-items: center; }
.matrix-subject-heading small { grid-column: 1 / -1; font-size: 0.61rem; font-weight: 750; opacity: 0.8; }
.matrix-subject-heading button, .matrix-group-select { width: 25px; height: 25px; border: 1px solid currentColor; border-radius: 50%; background: white; color: #0f766e; font-weight: 900; cursor: pointer; }
.subject-band-header.is-selected, .teaching-sheet td.is-selected { outline: 3px solid #0f766e; outline-offset: -3px; }
.matrix-group-select { position: absolute; z-index: 2; top: 4px; right: 4px; }
.matrix-cell { position: relative; }
.matrix-shared-group-cell { background: #eefaf5; box-shadow: inset 4px 0 #16836f; }
.matrix-shared-label { border-radius: 5px; background: #d9f2e8; padding: 3px 5px; color: #145c4c; font-weight: 800; }
.matrix-unavailable-cell { background: #eef1f4 !important; color: #7b8794; }
.matrix-unavailable-content { min-height: 58px; display: grid; place-items: center; border: 1px dashed #b7c0ca; border-radius: 6px; background: #e5e9ee; text-align: center; font-size: 0.68rem; font-weight: 800; }
.band-color-0 { background: #fff0b8 !important; color: #6b4e00 !important; }
.band-color-1 { background: #dceeff !important; color: #174f7d !important; }
.band-color-2 { background: #e4f6df !important; color: #28631f !important; }
.band-color-3 { background: #f1e3ff !important; color: #61338a !important; }
.band-color-4 { background: #ffe1e7 !important; color: #8b2940 !important; }
.band-color-5 { background: #dff5f2 !important; color: #17665c !important; }
.band-color-6 { background: #ffe8d2 !important; color: #7a4215 !important; }
.band-color-7 { background: #e8e7ff !important; color: #403d8a !important; }

.user-management { display: grid; gap: 14px; }
.user-management-intro { display: grid; gap: 3px; border: 1px solid #bedfd7; border-radius: 12px; background: #eef8f7; padding: 13px 15px; color: var(--accent-strong); }
.user-management-intro span { color: var(--muted); }
.user-management-list { display: grid; gap: 12px; }
.user-access-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow-soft); }
.user-access-summary { display: flex; width: 100%; justify-content: space-between; gap: 16px; align-items: center; border: 0; padding: 14px 16px; background: #f8fafc; color: inherit; text-align: left; cursor: pointer; }
.user-access-summary:hover { background: #f0f5f8; }
.user-access-identity { display: grid; min-width: 0; gap: 2px; }
.user-access-identity strong { font-size: 1rem; }
.user-access-identity span, .user-access-identity small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.user-access-summary-status { display: flex; flex: 0 0 auto; gap: 7px; align-items: center; }
.user-role-pill, .user-blocked-pill { border-radius: 999px; padding: 5px 9px; background: #e5eef5; color: #244258; font-size: .72rem; font-weight: 850; }
.user-blocked-pill { background: #fee2e2; color: #991b1b; }
.user-access-chevron { font-size: 1.2rem; transition: transform .16s ease; }
.user-access-summary[aria-expanded="true"] .user-access-chevron { transform: rotate(180deg); }
.user-access-body { border-top: 1px solid var(--line); }
.user-access-body[hidden] { display: none; }
.user-access-settings { display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 12px; padding: 14px 16px 0; }
.user-access-settings > label { display: grid; gap: 4px; align-content: start; }
.user-access-settings > label > span:first-child { color: var(--muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.user-access-settings small { color: var(--muted); font-size: .68rem; }
.user-block-control > span:nth-child(2) { display: flex; min-height: 38px; gap: 8px; align-items: center; border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 9px; font-weight: 750; }
.user-access-card.is-blocked { border-color: #f1a7a7; }
.user-access-card.is-blocked .user-access-summary { background: #fff7f7; }
.user-access-card select { min-height: 38px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; padding: 6px 9px; font-weight: 750; }
.superadmin-role { border-radius: 8px; background: #173f5f; padding: 9px 12px; color: white; text-align: center; }
.user-view-permissions { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 8px; padding: 14px 16px; }
.user-view-permission { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 7px; align-items: center; border: 1px solid #d7dee7; border-radius: 9px; background: #f8fafc; padding: 8px 9px; cursor: pointer; }
.user-view-permission input { grid-row: 1 / 3; width: 17px; height: 17px; accent-color: #16836f; }
.user-view-permission span { overflow: hidden; font-size: 0.76rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.user-view-permission small { color: var(--muted); font-size: 0.63rem; }
.user-view-permission.is-allowed { border-color: #b9ddcf; background: #eef8f4; }
.user-view-permission.is-denied { opacity: 0.68; }
.user-view-permission.is-custom { box-shadow: inset 4px 0 #c17b00; }
.user-access-body > footer { display: flex; justify-content: flex-end; padding: 0 16px 14px; }

@media (max-width: 1180px) {
  .user-view-permissions { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .user-access-settings { grid-template-columns: 1fr; }
}

.planning-accounting-head, .planning-accounting-head > div { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; }
.planning-accounting-head > div:first-child { display: grid; justify-content: start; }
.planning-accounting-legend span { border-radius: 999px; background: #eef3f7; padding: 5px 9px; font-size: 0.76rem; font-weight: 750; }
.planning-accounting tr.accounting-tight td { background: #fff8df; }
.planning-accounting tr.accounting-over td { background: #fff1ef; color: #8f2d20; }

.planning-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.planning-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.planning-table th,
.planning-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.planning-table th {
  background: #eef3f7;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.planning-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.planning-priority,
.planning-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.priority-dura {
  border-color: #f2c7c0;
  background: #fff1ef;
  color: #9f2f20;
}

.priority-media {
  border-color: #efd79c;
  background: #fff8df;
  color: #805900;
}

.priority-flexible {
  border-color: #bedfd7;
  background: #eef8f7;
  color: var(--accent-strong);
}

.status-pendiente {
  border-color: #efd79c;
  background: #fff8df;
  color: #805900;
}

.status-validada {
  border-color: #bedfd7;
  background: #eef8f7;
  color: var(--accent-strong);
}

.status-en-conflicto {
  border-color: #f2c7c0;
  background: #fff1ef;
  color: #9f2f20;
}

.status-resuelta {
  border-color: #c8d7e7;
  background: #eff6ff;
  color: #1f5f9c;
}

.planning-controls {
  display: grid;
  gap: 14px;
}

.planning-requirement-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.planning-requirement-toolbar .planning-filter-row {
  min-width: 0;
}

.planning-requirement-modal .modal-card {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.planning-modal-form {
  border: 0;
  padding: 0;
}

.planning-filter-row,
.planning-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 13px;
}

.planning-form {
  background: white;
}

.planning-span-2 {
  grid-column: span 2;
}

.planning-span-3 {
  grid-column: span 3;
}

.planning-span-4 {
  grid-column: 1 / -1;
}

.planning-submit {
  align-self: end;
}

.room-reservations {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 13px;
}

.room-reservations-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.room-reservations h3 {
  margin: 0 0 4px;
}

.room-reservation-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 12px;
}

.room-reservation-teacher {
  display: grid;
  align-content: center;
  min-height: 42px;
  border: 1px solid #bedfd7;
  border-radius: var(--radius);
  background: #eef8f7;
  padding: 7px 10px;
  color: var(--accent-strong);
}

.room-reservation-teacher strong,
.room-reservation-teacher small {
  display: block;
}

.room-reservation-teacher small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.room-reservation-teacher.is-missing {
  border-color: #f2c7c0;
  background: #fff1ef;
  color: #9f2f20;
}

.room-reservation-recurring {
  grid-column: span 2;
  display: flex;
  align-items: end;
  border: 1px solid #b9d8f8;
  border-radius: var(--radius);
  background: #eff7ff;
  padding: 9px 11px;
}

.room-reservation-recurring > span {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
  color: #174ea6;
  cursor: pointer;
}

.room-reservation-recurring input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #1769c2;
}

.room-reservation-recurring.is-readonly > span {
  cursor: default;
}

#roomReservationDate:disabled {
  border-color: #d8dee6;
  background: #eef1f4;
  color: #89929d;
  cursor: not-allowed;
  opacity: 0.75;
}

.room-reservation-status {
  align-self: end;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.room-reservation-status.is-free {
  border-color: #bedfd7;
  background: #eef8f7;
  color: var(--accent-strong);
}

.room-reservation-status.is-busy {
  border-color: #f2c7c0;
  background: #fff1ef;
  color: #9f2f20;
}

.room-reservation-list {
  display: grid;
  gap: 8px;
}

.room-reservation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid #2563eb;
  border-radius: var(--radius);
  background: white;
  padding: 10px 12px;
}

.room-reservation-item strong,
.room-reservation-item span,
.room-reservation-item small {
  display: block;
}

.room-reservation-item span,
.room-reservation-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.room-reservation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  padding: 16px;
}

.modal-card.wide {
  width: min(840px, calc(100vw - 32px));
}

.modal-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ghost-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  font-size: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field.full {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-actions.spread {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
}

.form-error {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--rose);
  font-size: 0.88rem;
  font-weight: 700;
}

.edit-only {
  display: none;
}

.can-edit-all .edit-only,
.can-edit-guards.is-guards .edit-only {
  display: inline-flex;
}

.guard-only {
  display: none;
}

.can-edit-guards.is-guards .guard-only {
  display: inline-flex;
}

.direction-only,
.direction-panel-only,
.undo-only,
.management-only,
.mobile-only {
  display: none;
}

.management-only[hidden],
.mobile-only[hidden] {
  display: none !important;
}

.can-edit-all .direction-only,
.can-edit-all.is-direction-panel .direction-panel-only,
.is-editing .undo-only,
.can-edit-guards .management-only {
  display: inline-flex;
}

.notification-modal .modal-card {
  max-height: min(820px, calc(100dvh - 28px));
  overflow-y: auto;
}

.notification-permission,
.notification-actions,
.notification-history,
.notification-composer {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.notification-permission {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.notification-permission p {
  margin: 4px 0 0;
}

.notification-composer,
.notification-history {
  display: block;
  margin-top: 14px;
  padding: 16px;
}

.notifications-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.notification-unread-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 6px;
  color: #fff;
  background: #dc2626;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.notification-unread-badge[hidden] {
  display: none;
}

.notification-composer[hidden] {
  display: none;
}

.notification-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.notification-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
  border: 0;
}

.notification-list {
  display: grid;
  gap: 9px;
}

.notification-history-head,
.notification-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-history-head h4 {
  margin: 0;
}

.notification-history-head .button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: #f7fafb;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  text-align: left;
}

.notification-item.is-unread {
  border-color: rgba(15, 118, 110, 0.24);
  border-left-color: var(--accent);
  background: #ecf8f6;
  cursor: pointer;
}

.notification-item.is-unread:hover {
  border-color: rgba(15, 118, 110, 0.48);
  background: #e3f4f1;
}

.notification-item.is-read {
  border-left-color: #94a3b8;
  background: #f8fafc;
  cursor: pointer;
}

.notification-item.is-read:hover {
  border-color: rgba(100, 116, 139, 0.28);
  background: #f1f5f9;
}

.notification-envelope {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(15, 118, 110, 0.1);
}

.notification-item.is-read .notification-envelope {
  color: #64748b;
  background: #e2e8f0;
}

.notification-envelope svg,
.notification-detail-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-item-content {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.notification-item time {
  color: var(--muted);
  font-size: 0.75rem;
}

.notification-item-body {
  margin-top: 4px;
  display: -webkit-box;
  overflow: hidden;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-detail-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-detail-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(15, 118, 110, 0.1);
}

.notification-detail-date {
  display: block;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.notification-detail-body {
  min-height: 90px;
  margin: 18px 0;
  white-space: pre-wrap;
  line-height: 1.6;
}

.notification-detail-actions {
  justify-content: space-between;
}

.notification-new-badge {
  border-radius: 999px;
  padding: 3px 7px;
  color: #fff;
  background: var(--accent);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notification-read-hint,
.notification-read-state {
  margin-top: 5px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
}

.notification-read-state {
  color: var(--muted);
}

.mobile-nav {
  position: fixed;
  inset: auto 0 0;
  z-index: 34;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  border-top: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.12);
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  backdrop-filter: blur(14px);
}

.mobile-nav button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #526077;
  font-size: 1rem;
}

.mobile-nav button[hidden] {
  display: none;
}

.mobile-nav button strong {
  font-size: 0.68rem;
}

.mobile-nav button.is-active {
  background: #eaf7f5;
  color: #0f766e;
}

.mobile-schedule {
  display: grid;
  gap: 10px;
}

.schedule-grid.is-mobile-schedule {
  display: block;
  min-width: 0;
  padding: 8px;
}

.is-mobile-schedule .schedule-grid-embedded {
  min-width: 0;
}

.mobile-day-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fff;
  padding: 4px 0 8px;
}

.mobile-day-tabs button {
  display: grid;
  gap: 1px;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #526077;
  font-size: 0.72rem;
  font-weight: 800;
}

.mobile-day-tabs button small {
  color: var(--muted);
  font-size: .56rem;
  font-weight: 700;
}

.mobile-day-tabs button.is-active {
  border-color: #72b9b1;
  background: #eaf7f5;
  color: #0f766e;
}

.mobile-schedule-list {
  display: grid;
  gap: 8px;
}

.mobile-schedule-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 9px;
  align-items: stretch;
}

.mobile-schedule-time {
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #eef3f7;
  color: #314158;
  padding: 8px 5px;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.mobile-schedule-events {
  display: grid;
  gap: 6px;
}

.mobile-schedule-events .event-card,
.mobile-schedule-events .empty-slot {
  width: 100%;
  min-height: 54px;
}

.mobile-empty-slot {
  display: grid;
  place-items: center start;
  min-height: 52px;
  border: 1px dashed #d6dde6;
  border-radius: 11px;
  color: #8590a2;
  padding: 10px 12px;
  font-size: 0.78rem;
}

.is-editing #editModeBtn {
  background: #334155;
}

.is-move-mode #moveModeBtn {
  border-color: #15803d;
  background: #166534;
  color: #fff;
}

.move-target {
  position: relative;
  background: #ecfdf3;
  box-shadow: inset 0 0 0 1px #86efac;
}

.move-target--free {
  background: #ecfdf3;
  box-shadow: inset 0 0 0 2px #22c55e;
}

.move-target--swap {
  background: #fff7ed;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.move-target-button {
  width: 100%;
  min-height: 100%;
  border: 0;
  background: transparent;
  color: #166534;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.move-target:hover {
  background: #d1fae5;
  box-shadow: inset 0 0 0 2px #22c55e;
}

.move-target--swap:hover,
.move-target--swap.is-drag-over {
  background: #ffedd5;
  box-shadow: inset 0 0 0 3px #f97316;
}

.move-target--free.is-drag-over {
  background: #d1fae5;
  box-shadow: inset 0 0 0 3px #16a34a;
}

.move-target-label,
.move-target-button--swap {
  position: absolute;
  inset: 4px;
  z-index: 4;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgb(255 255 255 / 88%);
  color: #166534;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 850;
  pointer-events: none;
}

.move-target--swap .move-target-label,
.move-target-button--swap {
  color: #9a3412;
}

.move-target-button--swap {
  cursor: pointer;
  pointer-events: auto;
}

.event-card[data-move-record-id] {
  cursor: grab;
  touch-action: none;
}

.event-card.is-drag-source {
  cursor: grabbing;
  opacity: 0.72;
  outline: 3px solid #166534;
  outline-offset: 1px;
}

.event-card.is-move-source {
  outline: 3px solid #166534;
  outline-offset: 1px;
}

.is-move-mode .event-card.is-move-locked {
  cursor: pointer;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.assistant-launch {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 35;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid #0f766e;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  padding: 12px 18px;
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.28);
}

.assistant-launch[hidden] {
  display: none !important;
}

.assistant-launch:hover {
  background: #115e59;
}

.assistant-panel {
  position: fixed;
  left: 24px;
  bottom: 82px;
  z-index: 40;
  width: min(430px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 112px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(23, 33, 63, 0.24);
}

.assistant-panel[hidden] {
  display: none;
}

.assistant-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #effaf8, #ffffff);
}

.assistant-head h2 {
  color: var(--ink);
  font-size: 1.1rem;
}

.assistant-kicker {
  margin: 0 0 3px;
  color: #0f766e;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.assistant-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid #dbe7e5;
  background: #f6fbfa;
}

.assistant-quick-actions.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.assistant-quick-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  border: 1px solid #b8d8d4;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  box-shadow: 0 2px 7px rgba(23, 33, 63, 0.06);
  cursor: pointer;
}

.assistant-quick-action:hover {
  border-color: #0f766e;
  background: #effaf8;
  transform: translateY(-1px);
}

.assistant-quick-action:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.assistant-quick-action:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.assistant-quick-action[hidden] {
  display: none;
}

.assistant-quick-action-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #dff3ef;
  color: #0f766e;
  font-size: 1.1rem;
  font-weight: 900;
}

.assistant-quick-action.is-absence .assistant-quick-action-icon {
  background: #e8eef9;
  color: #244d86;
}

.assistant-quick-action strong,
.assistant-quick-action small {
  display: block;
}

.assistant-quick-action strong {
  font-size: 0.79rem;
  line-height: 1.15;
}

.assistant-quick-action small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.25;
}

.assistant-suggestions {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid #edf0f4;
  background: #fbfcfd;
  scrollbar-width: thin;
}

.assistant-suggestion {
  flex: 0 0 auto;
  max-width: 250px;
  border: 1px solid #cfe4e1;
  border-radius: 999px;
  background: #ffffff;
  color: #115e59;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.assistant-suggestion:hover {
  background: #effaf8;
}

.assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  background: #f7f9fb;
}

.assistant-message {
  max-width: 92%;
  border: 1px solid #dde3eb;
  border-radius: 14px;
  background: #ffffff;
  color: #263247;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 5px rgba(23, 33, 63, 0.04);
}

.assistant-message.is-user {
  align-self: flex-end;
  border-color: #b9ddd8;
  background: #eaf7f5;
  color: #0f514b;
}

.assistant-message.is-assistant {
  align-self: flex-start;
}

.assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.assistant-form textarea {
  min-height: 48px;
  max-height: 130px;
  resize: vertical;
}

.assistant-form .button {
  min-height: 48px;
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: auto auto;
  }

  .topbar .view-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .top-actions {
    justify-self: end;
  }

  .responsibility-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .planning-readiness {
    grid-template-columns: 1fr;
  }

  .responsibility-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: center;
  }

  .topbar .view-tabs {
    width: 100%;
    flex-wrap: wrap;
  }

  .brand {
    min-width: 0;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .draft-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .draft-actions {
    flex-wrap: wrap;
  }

  .draft-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }


  .summary-strip,
  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guard-planner {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle {
    right: 38px;
    left: auto;
  }

  .workspace.is-sidebar-collapsed .sidebar-toggle {
    right: auto;
    left: 34px;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .panel-head {
    flex-direction: column;
  }

  .panel-tools {
    justify-content: flex-start;
  }

  .entity-list {
    max-height: 280px;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }

  .mobile-only {
    display: inline-flex;
  }

  .mobile-nav {
    display: grid;
  }

  .assistant-launch {
    display: none;
  }

  .assistant-panel {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .assistant-quick-actions {
    padding: 10px 12px;
  }

  .topbar,
  .summary-strip,
  .workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .detail-grid,
  .form-grid,
  .direction-controls,
  .planner-controls,
  .planning-filter-row,
  .planning-form,
  .room-reservation-form,
  .substitution-controls,
  .hour-picker,
  .guard-export-panel,
  .substitution-row {
    grid-template-columns: 1fr;
  }

  .room-reservation-recurring {
    grid-column: auto;
  }

  .planning-board-head {
    flex-direction: column;
  }

  .planning-requirement-toolbar {
    grid-template-columns: 1fr;
  }

  .room-reservations-head,
  .room-reservation-item {
    grid-template-columns: 1fr;
  }

  .room-reservations-head {
    flex-direction: column;
  }

  .room-reservation-actions {
    justify-content: stretch;
  }

  .room-reservation-actions .button {
    flex: 1;
  }

  .planning-actions {
    justify-content: flex-start;
  }

  .planning-span-2,
  .planning-span-3 {
    grid-column: auto;
  }

  .brand {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .brand-logo {
    width: 132px;
  }

  .top-actions {
    display: flex;
    flex-wrap: nowrap;
    overflow: visible;
    padding-bottom: 0;
  }

  .top-actions .button,
  .top-actions label {
    flex: 0 0 auto;
  }

  #resetBtn {
    display: none !important;
  }

  .summary-strip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .summary-card {
    flex: 0 0 148px;
    scroll-snap-align: start;
  }

  .topbar .view-tabs {
    display: none;
  }

  .view-tabs > * + * {
    margin-left: 5px;
  }

  .view-tabs > * + *::before {
    left: -6px;
    height: 22px;
  }

  .view-tabs::-webkit-scrollbar {
    display: none;
  }

  .view-menu-popover {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 12px;
    max-height: min(56vh, 420px);
    overflow-y: auto;
  }

  .tab-button {
    min-height: 42px;
    padding: 8px 11px;
    gap: 7px;
    font-size: 0.78rem;
  }

  .view-menu-trigger {
    min-height: 42px;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .nav-icon svg {
    width: 17px;
    height: 17px;
  }

  .workspace {
    gap: 10px;
  }

  .sidebar {
    padding: 12px;
  }

  .entity-list {
    display: flex;
    gap: 7px;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .entity-row {
    flex: 0 0 min(240px, 76vw);
  }

  .entity-button {
    min-height: 54px;
  }

  .panel-head {
    gap: 8px;
  }

  .panel-head h2 {
    font-size: 1.18rem;
  }

  .metric-row {
    display: flex;
    overflow-x: auto;
  }

  .metric {
    flex: 0 0 128px;
  }


  .sidebar,
  .main-panel {
    box-shadow: none;
  }

  .main-panel {
    padding: 12px;
  }

  .panel-tools {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-tools .button {
    width: 100%;
  }

  .modal-actions.spread {
    grid-template-columns: 1fr;
  }

  .notification-modal {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
  }

  .notification-modal .modal-card {
    width: 100%;
    min-height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .notification-permission {
    align-items: stretch;
    flex-direction: column;
  }

  .notification-fields {
    grid-template-columns: 1fr;
  }

  .notification-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media print {
  .topbar,
  .view-tabs,
  .sidebar,
  .panel-tools,
  .summary-strip,
  .details-panel {
    display: none !important;
  }

  .assistant-launch,
  .assistant-panel {
    display: none !important;
  }

  .workspace,
  .main-panel {
    display: block;
    padding: 0;
    border: 0;
  }

  .schedule-wrap {
    overflow: visible;
  }

  .schedule-wrap:has(.teacher-load-report) {
    max-height: none;
  }

  .teacher-load-report thead th {
    position: static;
  }

  .teacher-load-report tbody tr:not(.teacher-load-stage-row) > td:first-child {
    position: static;
  }
}
.meeting-participant-editor {
  border: 1px solid #d7dee8;
  border-radius: 14px;
  padding: 14px;
}

.meeting-participant-editor legend {
  color: #7c1d27;
  font-weight: 800;
  padding: 0 6px;
}

.meeting-participant-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 7px 12px;
  max-height: 280px;
  overflow: auto;
}

.meeting-participant-list label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.record-readonly-field {
  background: #f7f9fc;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  display: grid;
  gap: 5px;
  padding: 12px 14px;
}

.record-readonly-field span {
  color: #68758a;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.availability-sidebar-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #b8d8d3;
  border-radius: 14px;
  background: linear-gradient(145deg, #f7fcfb, #eef8f6);
}

.availability-sidebar-card > span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: .78rem;
}

.availability-sidebar-card small,
.availability-note span {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}

.availability-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #0f766e;
}

.availability-legend-dot--aulas-especiales { background: #7c3aed; }
.availability-legend-dot--salas-de-reuniones { background: #b45309; }

.room-availability {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #f7fafb;
}

.room-week-view {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #f7fafb;
}

.room-week-schedule-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.room-week-range {
  align-self: center;
  margin-left: auto;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
}

.room-availability-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: end;
}

.room-availability-toolbar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.room-availability-toolbar input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 7px 10px;
  color: var(--ink);
  font: inherit;
  font-size: .8rem;
}

.room-availability-table-wrap {
  max-height: calc(100vh - 330px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  scrollbar-width: thin;
}

.room-availability-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.room-availability-table th,
.room-availability-table td {
  border-right: 1px solid #e1e7ec;
  border-bottom: 1px solid #e1e7ec;
  padding: 8px;
  vertical-align: top;
}

.room-availability-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #eaf1f5;
  color: var(--ink);
  font-size: .76rem;
  text-align: center;
}

.room-availability-table thead th:first-child {
  left: 0;
  z-index: 8;
  width: 92px;
}

.room-availability-table thead small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 700;
}

.room-availability-table tbody th {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 92px;
  background: #f8fafb;
  color: #4b596d;
  font-size: .7rem;
  text-align: center;
  vertical-align: middle;
}

.room-availability-table tbody tr:nth-child(even) td { background: #fbfcfd; }
.room-availability-table th:last-child,
.room-availability-table td:last-child { border-right: 0; }

.availability-cell-content {
  display: grid;
  gap: 7px;
}

.availability-cell-content > strong,
.availability-empty strong {
  color: #0f766e;
  font-size: .68rem;
}

.availability-room-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.availability-room {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #9fd0c9;
  border-radius: 999px;
  background: #edf9f7;
  padding: 3px 7px;
  color: #134e4a;
  font-size: .62rem;
  font-weight: 760;
  line-height: 1.1;
}

.availability-room--aulas-especiales {
  border-color: #c4b5fd;
  background: #f5f3ff;
  color: #5b21b6;
}

.availability-room--salas-de-reuniones {
  border-color: #f4c77b;
  background: #fff8e8;
  color: #92400e;
}

.availability-empty {
  display: grid;
  gap: 3px;
  place-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: .65rem;
  text-align: center;
}

.availability-note {
  display: flex;
  gap: 10px;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafb;
  padding: 11px 13px;
}

@media (max-width: 760px) {
  .room-availability-toolbar { align-items: stretch; }
  .room-availability-toolbar .button,
  .room-availability-toolbar label { flex: 1 1 160px; }
  .room-availability-toolbar input { width: 100%; }
  .room-week-range { flex: 1 0 100%; margin-left: 0; text-align: center; }
  .room-availability-table-wrap { max-height: calc(100dvh - 280px); }
}

/* Directorio de tutores */
.is-tutors .schedule-grid,
.is-extensions .schedule-grid {
  display: block;
  min-width: 0;
  background: #f5f8fa;
}

.tutor-directory-table.extensions-table { min-width: 660px; }
.tutor-directory-table.extensions-table tbody th { white-space: normal; min-width: 160px; }
.extension-number { font-weight: 800; font-variant-numeric: tabular-nums; }
.extension-phone { display: inline-block; padding: 9px 0; color: #11635e; font-weight: 700; white-space: nowrap; }

@media (max-width: 640px) {
  .is-extensions .tutor-table-wrap { max-height: none; border: 0; background: transparent; }
  .is-extensions .extensions-table { display: block; min-width: 0; }
  .extensions-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .extensions-table tbody { display: grid; gap: 12px; }
  .extensions-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; background: white; border: 1px solid #dce5e8; border-radius: 12px; overflow: hidden; }
  .is-extensions .extensions-table tbody tr > * { display: block; padding: 12px; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .extensions-table tbody th, .extensions-table tbody td:last-child { grid-column: 1 / -1; }
  .extensions-table [data-label]::before { content: attr(data-label); display: block; color: #566b78; font-size: .72rem; font-weight: 500; margin-bottom: 4px; }
  .extensions-table .extension-phone { padding: 0; }
}

.tutor-directory {
  padding: 16px;
  min-width: 0;
}

.tutor-table-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid #dce5e8;
  border-radius: 12px;
  background: white;
}
.tutor-table-wrap:focus-visible { outline: 2px solid #157d76; outline-offset: 3px; }
.tutor-directory-table {
  width: 100%;
  min-width: 840px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: .82rem;
  line-height: 1.4;
}
.tutor-directory-table th,
.tutor-directory-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #e6ecef;
  vertical-align: middle;
  text-align: left;
}
.tutor-directory-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf1f5;
  color: #263b4e;
  font-size: .77rem;
  font-weight: 800;
  white-space: nowrap;
  border-bottom-color: #cbd8df;
}
.tutor-directory-table tbody tr { scroll-margin-block: 60px; }
.tutor-directory-table tbody tr:nth-child(even) { background: #f8fafb; }
.tutor-directory-table tbody tr:hover { background: #edf6f5; }
.tutor-directory-table tbody tr:last-child > * { border-bottom: 0; }
.tutor-directory-table .tutor-stage-start > * { border-top: 2px solid #cbd8df; }
.tutor-directory-table tbody th { color: #11635e; font-weight: 800; white-space: nowrap; }
.tutor-directory-table .tutor-table-name { color: #243944; font-weight: 700; min-width: 170px; }
.tutor-table-email { min-width: 180px; overflow-wrap: anywhere; }
.tutor-table-email a { color: #11635e; text-underline-offset: 3px; }
.tutor-table-email a:hover { color: #094a46; }
.tutor-stage-label { color: #63747f; font-size: .75rem; }
.tutor-entity-button { width: 100%; text-align: left; }

.tutor-directory-empty {
  display: grid;
  gap: 5px;
  place-items: center;
  min-height: 220px;
  border: 1px dashed #b9c8ce;
  border-radius: 14px;
  background: white;
  color: var(--muted);
  text-align: center;
}

.tutor-directory-empty strong { color: var(--ink); }

@media (max-width: 760px) {
  .tutor-directory { padding: 10px; }
  .tutor-directory-table th,
  .tutor-directory-table td { padding: 9px 11px; }
}
:root { --guard-comment-border: #d8e2e9; }
.guard-comment-block { margin-top: 24px; padding: 18px; border: 1px solid var(--guard-comment-border); border-radius: 12px; background: #fff; }
.guard-comment-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.guard-comment-toolbar button, .guard-comment-toolbar select { box-sizing: border-box; height: 38px; min-height: 38px; width: auto; margin: 0; padding: 7px 12px; border: 1px solid #ccd7e0; border-radius: 8px; background: #f8fafc; color: #17213f; font: inherit; font-size: 14px; line-height: 20px; }
.guard-comment-toolbar label { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; font-size: 14px; line-height: 20px; }
.guard-comment-toolbar select { min-width: 110px; max-width: 150px; }
.guard-comment-toolbar button:hover { background: #edf2f7; }
.guard-comment-toolbar button:focus-visible, .guard-comment-toolbar select:focus-visible { outline: 2px solid #0f766e; outline-offset: 2px; }
.button.secondary.guard-comment-remove { background: #fff0f0; color: #a72d36; border-color: #efbec3; }
.button.secondary.guard-comment-remove:hover { background: #ffe2e5; border-color: #df929b; }
.guard-comment-editor { min-height: 150px; max-height: 480px; overflow: auto; padding: 12px; border: 1px solid #ccd7e0; border-radius: 8px; }
.guard-comment-editor, .guard-comment-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.guard-comment-editor ul, .guard-comment-body ul { list-style: disc; padding-left: 26px; }
.guard-comment-editor ol, .guard-comment-body ol { list-style: decimal; padding-left: 26px; }
/* Course preparation is isolated from the operational timetable views. */
.planning-reference-panel {
  display: grid;
  gap: 1rem;
}
.planning-reference-panel > section {
  padding: 1.25rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #dce3df);
  border-radius: 12px;
}
.planning-reference-panel h4,
.planning-preparation-issues h4 {
  margin: 0 0 .65rem;
}
.planning-reference-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
}
.planning-reference-actions .field {
  flex: 1 1 320px;
}
.planning-preparation-issues {
  grid-column: 1 / -1;
}
.planning-preparation-issues li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
}
.planning-preparation-issues li span { flex: 1; }
.planning-sync-status { font-size: .85rem; }
.planning-board button:disabled,
.planning-controls button:disabled { opacity: .55; cursor: not-allowed; }

/* Private movement previews. Green always means a completely checked proposal. */
.schedule-move-tools { display:flex; gap:16px; justify-content:space-between; align-items:center; padding:14px 18px; margin-bottom:14px; border:1px solid #a7d9be; border-radius:12px; background:#f0fdf4; }
.schedule-move-tools[hidden] { display:none; }
.schedule-move-tools p { margin:6px 0 0; max-width:850px; font-size:13px; line-height:1.5; }
.schedule-move-actions { display:flex; gap:8px; flex-wrap:wrap; }
.schedule-move-dialog { width:min(1000px,95vw); max-height:90vh; padding:24px; border:0; border-radius:16px; box-shadow:0 24px 90px #122c4355; }
.schedule-move-dialog::backdrop { background:#10203370; }
.schedule-move-list { overflow:auto; max-height:55vh; }
.schedule-move-list table { border-collapse:collapse; width:100%; text-align:left; }
.schedule-move-list th { position:sticky; top:0; background:#f0f5f3; padding:12px; }
.schedule-move-list td { border-bottom:1px solid #dbe5e0; padding:12px; vertical-align:top; }
.schedule-move-list small { display:block; color:#50646a; margin-top:4px; }
.schedule-move-dialog [data-move-error] { color:#ad2020; }
button.move-target-label { cursor:pointer; pointer-events:auto; z-index:5; position:relative; inset:auto; margin-top:4px; padding:7px; border:1px solid #15803d; }
@media(max-width:760px) { .schedule-move-tools { flex-direction:column; align-items:stretch; } }

/* EAL keeps its own high-contrast color in every timetable view. */
.event-card.is-eal-event {
  background: #a21caf;
  border: 2px solid #701a75;
  color: #ffffff;
}
.event-card.is-eal-event strong,
.event-card.is-eal-event span {
  color: #ffffff;
}

.event-card.is-eal-event.is-soft-eal-event {
  background: #f1eaf6;
  border: 1px solid #c8b5d7;
  border-left: 4px solid #8466a0;
  color: #3d2d51;
}
.event-card.is-eal-event.is-soft-eal-event strong {
  color: #3d2d51;
}
.event-card.is-eal-event.is-soft-eal-event span {
  color: #60536f;
}

/* A modest title increase for Paz's library service, without changing workload. */
.event-card.is-paz-library[data-importance="tertiary"] strong {
  font-size: 0.67rem;
}

/* Library presence stays behind controls and never represents an occupied room. */
.has-library-presence {
  position: relative;
  min-height: 40px;
}

.library-presence {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b7bdc4;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  user-select: none;
}

.has-library-presence .empty-slot {
  position: relative;
  z-index: 1;
}

.guard-export-panel .guard-send-pdf {
  grid-column: 1 / -1;
  height: 60px;
  min-height: 60px;
  padding: 0 10px;
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.guard-export-panel .guard-send-pdf:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.top-actions #editModeBtn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: 12px;
}
.account-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.account-preview-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; }
.account-menu-identity { display: block; padding: 3px 6px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; overflow-wrap: anywhere; }

@media (min-width: 761px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 10px 16px; }
  .topbar .brand-logo { width: clamp(140px, 13vw, 200px); max-height: 44px; }
  .topbar .view-tabs { grid-column: 2; grid-row: 1; justify-self: center; width: fit-content; flex-wrap: nowrap; gap: 4px; padding: 4px; border-radius: 14px; }
  .topbar .top-actions { grid-column: 3; grid-row: 1; justify-self: end; }
  .topbar .tab-button { min-height: 40px; padding: 8px 10px; gap: 6px; font-size: .85rem; font-weight: 750; }
  .topbar .view-menu-trigger { min-height: 40px; border-radius: 10px; }
  .topbar .view-menu-toggle { padding: 0 8px; }
  .topbar .view-tabs > * + * { margin-left: 4px; }
  .topbar .view-tabs > * + *::before { left: -5px; height: 24px; }
  .topbar .nav-count { min-width: 22px; padding: 3px 5px; font-size: .68rem; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .topbar { gap: 8px; padding: 8px 12px; }
  .topbar .brand-logo { width: 120px; }
  .topbar .view-tabs { gap: 2px; }
  .topbar .tab-button { padding: 8px 6px; font-size: .75rem; gap: 4px; }
  .topbar .nav-icon { display: none; }
  .topbar .view-menu-toggle { padding: 0 6px; }
  .topbar .view-tabs > * + * { margin-left: 2px; }
  .topbar .view-tabs > * + *::before { left: -3px; }
}

/* STEAM: keep the activity palette visible also for extracurricular blocks. */
.event-card.is-steam-activity {
  background: var(--event-bg);
  border-left-color: var(--event-accent);
  color: #17213f;
}
.event-card.is-steam-activity strong { color: #17213f; }
.event-card.is-steam-activity span,
.event-card.is-steam-activity .badge { color: #334155; }
