:root {
  --bg: #eef3f8;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #f8fbff;
  --surface-accent: #eef6ff;
  --text: #122033;
  --muted: #5c6b7d;
  --accent: #0f766e;
  --accent-dark: #0b5b55;
  --accent-soft: #dff6f3;
  --line: rgba(160, 180, 201, 0.28);
  --shadow: 0 18px 50px rgba(31, 52, 84, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(27, 99, 184, 0.16), transparent 30%),
    linear-gradient(180deg, #f4f8fc 0%, #eaf1f8 100%);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 24px auto 40px;
  position: relative;
  z-index: 1;
}

.page-shell-wide {
  width: min(1380px, calc(100% - 40px));
}

.app-footer {
  margin: 22px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.app-footer p {
  margin: 0;
}

.app-footer-live {
  margin: 14px auto 22px;
  color: rgba(228, 240, 255, 0.72);
}

.toast-viewport {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  padding: 14px 16px 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: 0 20px 42px rgba(19, 35, 60, 0.16);
  backdrop-filter: blur(16px);
  transform: translateX(22px);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast.is-hiding {
  opacity: 0;
  transform: translateX(18px);
}

.toast-success::before {
  background: #198754;
}

.toast-error::before {
  background: #cf3f4c;
}

.toast-info::before {
  background: #1b63b8;
}

.toast-title {
  display: block;
  margin: 0 0 4px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.toast-message {
  display: block;
  margin: 0;
  line-height: 1.35;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(26px);
  pointer-events: none;
  opacity: 0.7;
}

.bg-orb-a {
  width: 280px;
  height: 280px;
  top: 32px;
  right: 4vw;
  background: rgba(15, 118, 110, 0.14);
}

.bg-orb-b {
  width: 320px;
  height: 320px;
  left: 2vw;
  bottom: 6vh;
  background: rgba(27, 99, 184, 0.12);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  padding: 28px 30px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 253, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-saas {
  align-items: center;
}

.top-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.lang-switcher label {
  color: var(--muted);
  font-size: 0.9rem;
}

.lang-switcher select,
.live-lang-switcher select {
  min-height: 38px;
  border-radius: 12px;
  padding: 6px 10px;
}

.top-nav a,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.top-nav a:hover,
.button-link:hover,
.top-nav a.is-current {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(255, 255, 255, 0.96);
}

.button-link-accent {
  background: linear-gradient(135deg, var(--accent), #1b63b8);
  color: #fff;
  border: none;
}

.button-link-accent:hover,
.button-link-accent:focus-visible,
.top-nav a.button-link-accent:hover,
.top-nav a.button-link-accent.is-current {
  background: linear-gradient(135deg, #0d6b64, #195ca9);
  color: #fff;
  border: none;
}

.hero-copy-wrap {
  display: grid;
  gap: 12px;
}

.hero-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-tag {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.inline-form {
  margin: 0;
}

.flash {
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
}

.flash-success {
  border-color: #b6d7b9;
  background: #eef8ee;
}

.flash-error {
  border-color: #e8b8b8;
  background: #fff0f0;
}

.flash-warning {
  border-color: #ead9a6;
  background: #fff8df;
}

.is-toast-flash {
  display: none;
}

.single-column,
.marketing-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.single-column {
  max-width: 720px;
}

.marketing-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.auth-card {
  max-width: 520px;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
  align-items: stretch;
}

.login-showcase,
.login-card {
  min-height: 100%;
}

.login-showcase {
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 248, 255, 0.92));
}

.login-showcase h2,
.login-card h2 {
  margin: 0 0 10px;
}

.login-secondary-action {
  margin: 14px 0 0;
}

.login-highlights {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-highlight {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(160, 180, 201, 0.18);
}

.login-highlight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(27, 99, 184, 0.16));
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.login-highlight strong {
  display: block;
  margin-bottom: 6px;
}

.login-highlight p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-card {
  padding: 26px;
  display: grid;
  align-content: center;
}

.card-feature h2,
.card-elevated h2 {
  margin-top: 0;
}

.section-kicker {
  margin-bottom: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.section-copy {
  margin-top: -6px;
  margin-bottom: 18px;
  color: var(--muted);
}

.dashboard-toolbar {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
}

.dashboard-toolbar::after {
  content: "";
  position: absolute;
  inset: auto -8% -40% auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.18), transparent 66%);
  pointer-events: none;
}

.toolbar-copy h2 {
  margin: 0 0 8px;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: min(320px, 100%);
  justify-content: flex-end;
}

.dashboard-filters label {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
  text-align: right;
}

.dashboard-filter-field {
  display: grid;
  grid-template-columns: auto minmax(180px, 220px);
  gap: 10px 12px;
  align-items: center;
  justify-content: end;
}

.user-admin-list {
  display: grid;
  gap: 18px;
}

.scrollable-panel {
  max-height: 980px;
  overflow: auto;
  padding-right: 6px;
}

.subscription-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffaf3;
}

.subscription-card h3,
.subscription-card p {
  margin: 0;
}

.subscription-card textarea {
  min-height: 90px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
}

.scrollable-list {
  max-height: 220px;
  overflow-y: auto;
}

.admin-grid .table-wrap {
  max-height: 420px;
  overflow: auto;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #155e75;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 56ch;
  color: var(--muted);
  margin-bottom: 0;
}

.date-panel,
.card,
.stat-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
}

.date-panel {
  min-width: 220px;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
}

.stats-grid,
.content-grid,
.admin-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

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

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

#resourcesSection .content-grid,
#dailySection .content-grid,
#timetableSection .content-grid {
  grid-template-columns: 1fr;
  align-items: start;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

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

.view-switcher {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.view-button {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  border: 1px solid var(--line);
}

.view-button.is-active {
  background: var(--accent);
  color: #fff;
}

.stat-card,
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 249, 255, 0.86));
}

.stat-label {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 2rem;
}

.card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.84));
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.card-header h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.login-form.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.login-form input[type="hidden"] {
  display: none;
}

.login-form > * {
  width: 100%;
}

.form-stack {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.field-stack {
  display: grid;
  gap: 8px;
}

.field-stack label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.settings-panel {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 250, 255, 0.84));
}

.settings-panel-header {
  display: grid;
  gap: 6px;
}

.settings-panel-header h3 {
  margin: 0;
  font-size: 1rem;
}

.settings-panel-header .helper-text {
  margin: 0;
}

.settings-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

#schoolSettingsForm {
  grid-template-columns: 1fr;
}

#schoolSettingsForm .settings-panel,
#schoolSettingsForm .form-span-2,
#schoolSettingsForm > button[type="submit"] {
  grid-column: 1 / -1;
}

.period-label-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.period-label-table {
  display: grid;
  gap: 10px;
}

.period-label-table-header,
.period-label-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(120px, 1fr) minmax(120px, 1fr) minmax(180px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.period-label-table-header {
  padding: 0 4px;
}

.period-label-table-header span {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.period-label-row {
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.period-label-period {
  display: flex;
  align-items: center;
  min-height: 46px;
}

.period-label-period strong {
  font-size: 0.94rem;
  color: var(--ink);
}

.period-label-cell small,
.period-label-preview small {
  font-size: 0.78rem;
  color: var(--muted);
}

.period-label-preview {
  display: grid;
  gap: 4px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
}

.period-label-preview strong {
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 900px) {
  .period-label-table-header {
    display: none;
  }

  .period-label-row {
    grid-template-columns: 1fr;
  }
}

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

.teacher-check-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.teacher-check-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.teacher-check-item.is-selected {
  border-color: rgba(11, 115, 91, 0.32);
  background: rgba(225, 247, 240, 0.95);
  box-shadow: 0 10px 24px rgba(11, 115, 91, 0.08);
}

.teacher-check-item input {
  margin-top: 2px;
}

.teacher-check-item strong {
  font-size: 0.95rem;
  line-height: 1.18;
}

.teacher-check-item small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.2;
  margin-top: 0;
}

.teacher-check-item-compact {
  padding: 8px 10px;
  gap: 9px;
  border-radius: 12px;
}

.teacher-check-item-compact strong {
  font-size: 0.9rem;
}

.teacher-check-item-compact small {
  font-size: 0.76rem;
}

#outdoorClassChecklist {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.search-field {
  display: grid;
}

.auto-substitution-bar {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 18px;
  justify-content: flex-end;
}

.auto-substitution-bar label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-right: auto;
}

input,
select,
button {
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
}

button {
  background: linear-gradient(135deg, var(--accent), #1b63b8);
  color: white;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  font-weight: 700;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(160, 180, 201, 0.18);
}

.dashboard-group .table-wrap {
  max-height: 420px;
  overflow: auto;
}

#timetableSection .table-wrap {
  max-height: 560px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

th,
td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(238, 246, 255, 0.8);
  position: sticky;
  top: 0;
  z-index: 3;
  backdrop-filter: blur(10px);
}

.sort-button {
  width: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  border: none;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-weight: 700;
  box-shadow: none;
}

.sort-button::after {
  content: "↕";
  font-size: 0.82rem;
  opacity: 0.45;
}

.sort-button.is-active::after {
  content: "↑";
  opacity: 0.9;
}

.sort-button.is-active.is-desc::after {
  content: "↓";
}

.sort-button:hover {
  transform: none;
  filter: none;
}

.is-uncovered-row td {
  background: rgba(255, 238, 238, 0.78);
}

.table-action-button {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.table-action-button.is-danger,
.button-danger {
  background: linear-gradient(135deg, #b42318, #d92d20);
  color: #fff;
  border-color: rgba(151, 18, 18, 0.32);
}

.table-actions-inline,
.form-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.danger-panel {
  margin: 14px 0 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(217, 45, 32, 0.22);
  background: linear-gradient(180deg, rgba(255, 241, 240, 0.96), rgba(255, 232, 229, 0.92));
}

.danger-panel strong {
  display: block;
  margin-bottom: 6px;
  color: #8f1d14;
}

.danger-panel p {
  margin: 0 0 12px;
}

.section-divider {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.chip-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, var(--surface-strong));
  border: 1px solid var(--line);
}

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

.helper-text {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.localized-date-field {
  position: relative;
  width: 100%;
}

.date-native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.localized-date-proxy {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}

.localized-date-proxy:hover {
  transform: none;
  filter: none;
  border-color: rgba(15, 118, 110, 0.3);
}

.localized-date-text {
  flex: 1 1 auto;
  line-height: 1.2;
}

.localized-date-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent);
  flex: 0 0 26px;
}

.localized-date-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.operations-stage,
.control-grid,
.workflow-strip {
  margin-top: 16px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.dashboard-sidebar {
  position: sticky;
  top: 20px;
  padding: 16px;
}

.dashboard-side-nav {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.dashboard-side-group {
  display: grid;
  gap: 6px;
}

.dashboard-side-link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 11px 18px 11px 16px;
  border-radius: 18px;
  color: var(--text);
  background: rgba(248, 251, 255, 0.76);
  border: 1px solid rgba(160, 180, 201, 0.16);
  text-align: left;
  box-shadow: none;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.dashboard-side-link span:last-child {
  display: block;
  line-height: 1.25;
}

.dashboard-side-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 999px;
  background: transparent;
}

.dashboard-side-link:hover,
.dashboard-side-link.is-active {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(255, 255, 255, 0.96);
  transform: none;
  filter: none;
}

.dashboard-side-link.is-active {
  background: linear-gradient(180deg, rgba(233, 248, 245, 0.95), rgba(247, 251, 255, 0.98));
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: 0 12px 28px rgba(27, 99, 184, 0.08);
}

.dashboard-side-link.is-active::before {
  background: linear-gradient(180deg, var(--accent), #1b63b8);
}

.dashboard-subnav {
  display: grid;
  gap: 4px;
  padding-left: 52px;
}

.dashboard-sub-link {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: none;
}

.dashboard-sub-link:hover {
  transform: none;
  filter: none;
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(15, 118, 110, 0.16);
  color: var(--text);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--accent);
  font-size: 1rem;
  background: rgba(15, 118, 110, 0.09);
  justify-self: center;
}

.dashboard-side-link.is-active .nav-icon {
  background: rgba(15, 118, 110, 0.16);
  color: var(--accent-dark);
}

.dashboard-main {
  min-width: 0;
}

.dashboard-group {
  display: none;
  animation: dashboardSectionIn 0.2s ease;
}

.dashboard-group.is-active {
  display: block;
}

.dashboard-group-heading {
  margin-bottom: 14px;
}

.dashboard-group-heading h2 {
  margin: 0 0 6px;
}

.dashboard-group-heading p {
  margin: 0;
  color: var(--muted);
}

@keyframes dashboardSectionIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.operations-stage {
  display: grid;
  gap: 14px;
}

.operations-hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.operations-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.operations-hero p {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
}

.operations-hero-status {
  display: grid;
  gap: 10px;
}

.status-tile {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.8);
  border: 1px solid rgba(160, 180, 201, 0.2);
}

.status-tile span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.status-tile strong {
  font-size: 1.08rem;
}

.status-tile-accent {
  background: linear-gradient(135deg, rgba(223, 246, 243, 0.86), rgba(238, 246, 255, 0.84));
}

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

.workflow-step {
  padding: 15px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 248, 255, 0.86));
  border: 1px solid rgba(160, 180, 201, 0.22);
  box-shadow: var(--shadow);
}

.workflow-step strong {
  display: block;
  margin: 12px 0 10px;
  font-size: 1.05rem;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.workflow-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(27, 99, 184, 0.12));
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.control-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.84rem;
}

.panel-badge-live {
  background: rgba(27, 99, 184, 0.12);
  color: #17417a;
}

.control-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.control-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.control-item strong,
.publication-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
}

.control-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.control-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 34px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.control-item.is-ok .control-state {
  background: #e6f8ef;
  color: #0a6b45;
}

.control-item.is-warning .control-state {
  background: #fff1dc;
  color: #9a6300;
}

.attention-panel {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.84), rgba(238, 246, 255, 0.9));
  border: 1px solid rgba(160, 180, 201, 0.18);
}

.attention-panel strong {
  display: block;
  margin-bottom: 12px;
}

.attention-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.publication-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.publication-metric {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(160, 180, 201, 0.2);
  background: rgba(255, 255, 255, 0.86);
}

.publication-metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.publication-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.legend-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(160, 180, 201, 0.18);
  background: rgba(248, 251, 255, 0.72);
}

.legend-card p,
.legend-card strong {
  margin: 0;
}

.legend-card p {
  margin-top: 4px;
  color: var(--muted);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-top: 4px;
  flex: 0 0 auto;
}

.legend-class {
  background: #1b63b8;
}

.legend-disp {
  background: #0f766e;
}

.legend-other {
  background: #c38a21;
}

textarea {
  width: 100%;
  min-height: 96px;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
}

.import-preview {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(238, 246, 255, 0.92), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(15, 118, 110, 0.16);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.preview-grid ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.preview-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.16);
}

.preview-banner strong,
.preview-banner p {
  margin: 0;
}

.preview-banner p {
  margin-top: 6px;
  color: var(--muted);
}

.preview-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border: 1px solid var(--line);
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.live-body {
  background:
    radial-gradient(circle at top left, rgba(17, 185, 129, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.16), transparent 26%),
    linear-gradient(180deg, #08131f 0%, #102133 100%);
  color: #eef6ff;
}

.live-shell {
  width: min(1380px, calc(100% - 40px));
  margin: 22px auto 36px;
}

.live-gate-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.live-gate-card {
  width: min(560px, 100%);
  padding: 34px 32px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(236, 245, 255, 0.95));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 26px 64px rgba(4, 10, 20, 0.34);
}

.live-gate-card h1 {
  margin-bottom: 10px;
}

.live-gate-card .hero-copy {
  margin-bottom: 22px;
}

.live-gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.live-gate-form {
  margin-top: 10px;
}

.live-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  padding: 24px 26px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(9, 22, 36, 0.96), rgba(14, 41, 66, 0.94));
  color: #f5fbff;
  border: 1px solid rgba(125, 211, 252, 0.18);
  box-shadow: 0 24px 60px rgba(4, 10, 20, 0.36);
}

.live-header .hero-copy,
.live-header .eyebrow {
  color: rgba(228, 240, 255, 0.76);
}

.live-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px 10px;
  align-items: end;
}

.live-controls label {
  color: rgba(228, 240, 255, 0.76);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.live-controls input,
.live-controls select {
  background: rgba(255, 255, 255, 0.92);
}

.live-control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  text-decoration: none;
  border: 1px solid rgba(16, 77, 129, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #1b63b8);
  color: #fff;
  box-shadow: 0 12px 26px rgba(9, 28, 52, 0.22);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.live-control-button:hover,
.live-control-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.3);
  background: linear-gradient(135deg, #0d6b64, #195ca9);
  box-shadow: 0 14px 30px rgba(9, 28, 52, 0.28);
}

.live-control-button:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.45);
  outline-offset: 2px;
}

.live-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 26px;
}

.live-button-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.live-button-label {
  line-height: 1.1;
}

.live-lang-switcher {
  display: grid;
}

.live-shell .stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.live-shell .stat-card {
  background:
    linear-gradient(180deg, rgba(13, 31, 49, 0.94), rgba(14, 41, 66, 0.9));
  border: 1px solid rgba(125, 211, 252, 0.12);
  color: #f5fbff;
  box-shadow: 0 18px 50px rgba(4, 10, 20, 0.28);
}

.live-shell .stat-label {
  color: rgba(228, 240, 255, 0.7);
}

.live-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

.live-grid .card {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(236, 245, 255, 0.95));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.live-grid .card-header h2 {
  font-size: 1.35rem;
}

.live-grid .table-wrap {
  border: 1px solid rgba(125, 145, 168, 0.18);
}

.live-grid th {
  background: rgba(220, 234, 252, 0.82);
}

.live-grid td {
  font-size: 1rem;
}

.live-grid table th:nth-child(6),
.live-grid table td:nth-child(6) {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm 13mm 16mm;
  }

  html,
  body,
  .live-body,
  .live-shell,
  .live-grid,
  .live-grid table,
  .live-grid thead,
  .live-grid tbody,
  .live-grid tr,
  .live-grid th,
  .live-grid td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-footer,
  .live-controls,
  .live-controls button,
  .live-controls a,
  .live-controls input,
  .live-controls label,
  .live-lang-switcher,
  .live-shell .stats-grid,
  .live-grid > article:last-child,
  .localized-date-proxy {
    display: none;
  }

  .date-native-input {
    position: static;
    opacity: 1;
    pointer-events: auto;
  }

  .live-body {
    background: #fff;
    color: #000;
  }

  .live-shell {
    width: 100%;
    margin: 0;
    padding: 0 1mm;
  }

  .live-header {
    padding: 0 1mm 7mm;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #000;
    box-shadow: none;
  }

  .live-header .hero-copy,
  .live-header .eyebrow {
    color: #444;
    margin: 0;
  }

  .live-header h1 {
    font-size: 18pt;
    margin: 0 0 2.5mm;
  }

  .live-grid {
    display: block;
    margin-top: 0;
  }

  .live-grid .card {
    padding: 0 1mm;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #000;
    box-shadow: none;
  }

  .live-grid .card-header {
    margin-bottom: 3mm;
    align-items: baseline;
    padding-bottom: 2mm;
    border-bottom: 1px solid #cfd6de;
  }

  .live-grid .card-header span {
    display: none;
  }

  .live-grid .card-header h2 {
    font-size: 12pt;
    margin: 0;
  }

  .live-grid .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .live-grid table {
    font-size: 10pt;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .live-grid thead {
    display: table-header-group;
  }

  .live-grid th,
  .live-grid td {
    padding: 7px 8px;
    color: #000;
    border-bottom: 1px solid #cfd6de;
    font-size: 10pt;
    line-height: 1.28;
    vertical-align: top;
  }

  .live-grid th {
    background: #e8edf3;
    font-size: 9pt;
  }

  .live-grid .sort-button {
    width: auto;
    display: inline;
    padding: 0;
    margin: 0;
    min-height: 0;
    background: transparent;
    color: inherit;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font: inherit;
    font-weight: 700;
    text-align: left;
  }

  .live-grid tbody tr:nth-child(even) td {
    background: #f4f7fa !important;
  }

  .live-grid tbody tr:nth-child(odd) td {
    background: #fff !important;
  }

  .live-grid .sort-button::after {
    display: none;
  }

  .live-grid tr,
  .live-grid td,
  .live-grid th {
    page-break-inside: avoid;
  }

  .live-grid tbody tr.is-uncovered-row:nth-child(odd) td {
    background: #fdf2f2 !important;
  }

  .live-grid tbody tr.is-uncovered-row:nth-child(even) td {
    background: #f7e9ea !important;
  }

  .live-grid tbody tr.is-uncovered-row td:first-child {
    box-shadow: inset 3px 0 0 #cc5b5b;
  }

  .app-footer-live {
    display: block;
    margin: 7mm 0 0;
    padding-top: 3mm;
    text-align: center;
    color: #555;
    font-size: 8.5pt;
    border-top: 1px solid #d8dee6;
  }

  .app-footer-live p {
    margin: 0;
  }
}

.is-hidden {
  display: none;
}

@media (max-width: 800px) {
  .hero {
    align-items: start;
    flex-direction: column;
  }

  .page-shell {
    width: min(100% - 20px, 1200px);
    margin-top: 16px;
  }

  .dashboard-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-filters {
    width: 100%;
    min-width: 0;
  }

  .dashboard-filter-field {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .dashboard-filters label {
    text-align: left;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    padding: 14px;
  }

  .dashboard-side-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(168px, 1fr);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .dashboard-side-link {
    min-width: 168px;
  }

  .operations-hero,
  .workflow-strip,
  .control-grid,
  .control-checklist,
  .publication-metrics {
    grid-template-columns: 1fr;
  }

  .live-header {
    flex-direction: column;
    align-items: stretch;
  }

  .live-controls,
  .live-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }
}
