:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #182c3d;
  background: #f3f6f9;
  font-size: 16px;
  --ink: #183e50;
  --accent: #007f78;
  --line: #e2e9ef;
  --muted: #5d7080;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}
aside {
  background: #123747;
  color: #fff;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 650;
  align-items: center;
}
.brand-icon {
  background: #00a59a;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 1.65rem;
}
.brand small,
.school small {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: #bfd2dc;
  margin-top: 4px;
}
.school {
  border-top: 1px solid #345463;
  border-bottom: 1px solid #345463;
  margin: 32px 0 24px;
  padding: 20px 0;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}
nav {
  display: grid;
  gap: 7px;
}
nav button {
  background: transparent;
  border: 0;
  color: #cce0e8;
  text-align: left;
  border-radius: 8px;
  padding: 13px 12px;
  font-size: 0.95rem;
}
nav button:hover,
nav button.active {
  background: #245363;
  color: #fff;
}
nav button.active {
  box-shadow: inset 3px 0 #40d7bf;
}
.aside-footer {
  margin-top: auto;
  padding-top: 36px;
  color: #b9cdd8;
  font-size: 0.8rem;
  line-height: 1.7;
}
.badge,
.pill {
  display: inline-block;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 0.8rem;
  background: #edf2f6;
  color: #345065;
  font-weight: 600;
  white-space: nowrap;
}
.badge {
  background: #244e5e;
  color: #a5efdc;
}
.pill.good {
  background: #e1f4eb;
  color: #146647;
}
.pill.warn {
  background: #fff0d8;
  color: #865309;
}
.pill.bad {
  background: #fde8e8;
  color: #9a3434;
}
main {
  padding: 36px 42px 18px;
  max-width: 1600px;
  width: 100%;
  min-width: 0;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
h1 {
  font-size: 1.9rem;
  letter-spacing: -0.03em;
  font-weight: 650;
  margin: 6px 0 0;
}
h2 {
  font-size: 1.2rem;
  margin: 0 0 8px;
}
h3 {
  font-size: 1.05rem;
  margin: 0 0 12px;
}
p {
  line-height: 1.6;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: var(--accent);
  margin: 0;
}
.local-label {
  border: 1px solid #ccdce4;
  border-radius: 30px;
  padding: 9px 15px;
  font-size: 0.85rem;
  color: #446274;
  white-space: nowrap;
}
.notice {
  background: #e8f2f3;
  border: 1px solid #cce1e3;
  border-left: 4px solid #00897e;
  border-radius: 8px;
  padding: 15px 18px;
  margin-bottom: 26px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.notice strong {
  display: block;
  color: #185551;
}
.notice span {
  color: #41646b;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat,
.card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 5px #112b3c03;
}
.stat .label {
  font-size: 0.9rem;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 10px 0 6px;
}
.stat small {
  color: var(--muted);
  font-size: 0.8rem;
}
.stat.accent {
  border-top: 3px solid var(--accent);
}
.grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin: 24px 0;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}
.card p {
  margin-top: 6px;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}
.steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.step-icon {
  background: #e4f4ef;
  color: #17775e;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  text-align: center;
  font-size: 0.8rem;
  line-height: 24px;
}
.steps small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}
.button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 11px 17px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.9rem;
}
.button.secondary {
  background: #edf3f6;
  color: #214758;
}
.button.danger {
  background: #a83e43;
}
.toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.toolbar label {
  display: grid;
  gap: 7px;
  font-size: 0.85rem;
  color: #405c6d;
}
.toolbar input,
.toolbar select {
  padding: 10px 12px;
  border: 1px solid #cbd9e1;
  border-radius: 6px;
  background: #fff;
  color: #183e50;
  min-height: 43px;
}
.toolbar input {
  min-width: 260px;
}
select {
  max-width: 100%;
}
.table-wrap {
  overflow: auto;
}
#backup-status {
  overflow-wrap: anywhere;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
th {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #5b7281;
  background: #f5f8fa;
  font-weight: 600;
}
td,
th {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td.number,
th.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.subtext {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 5px;
}
.empty {
  padding: 35px;
  text-align: center;
  color: var(--muted);
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}
.rule {
  padding: 16px;
  background: #f4f7f9;
  border-radius: 8px;
}
.rule small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.rule strong {
  font-size: 1.15rem;
}
.callout {
  padding: 15px 17px;
  background: #fff6e6;
  border-radius: 8px;
  color: #79551d;
  font-size: 0.9rem;
  line-height: 1.6;
}
.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr);
  gap: 22px;
}
.lab-frame {
  width: 100%;
  height: 470px;
  border: 1px solid #d4e0e7;
  border-radius: 9px;
  background: #f7fafb;
}
.status-line {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
}
.events {
  list-style: none;
  padding: 0;
  margin: 0;
}
.events li {
  font-size: 0.9rem;
  border-left: 2px solid #c8e4df;
  margin-left: 7px;
  padding: 2px 0 16px 16px;
  line-height: 1.6;
}
.events small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.job-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.job-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 7px;
  align-items: center;
}
.job-row button {
  font-size: 0.85rem;
}
.job-row small {
  font-size: 0.8rem;
  color: var(--muted);
}
#error {
  background: #fce8e8;
  border: 1px solid #efb9b9;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  color: #8d2e2e;
}
.phase-table td {
  white-space: normal;
  line-height: 1.5;
}
footer {
  color: #81909d;
  font-size: 0.8rem;
  margin-top: 36px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.source-note {
  overflow-wrap: anywhere;
  font-size: 0.85rem;
  color: var(--muted);
}
.progress-track {
  height: 8px;
  background: #eaf0f3;
  border-radius: 4px;
  margin: 18px 0;
}
.progress-track span {
  display: block;
  width: 10%;
  background: var(--accent);
  height: 100%;
  border-radius: 4px;
}
@media (max-width: 1200px) {
  main {
    padding: 28px 25px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid,
  .lab-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  aside {
    min-width: 0;
    height: auto;
    position: static;
    padding: 20px;
  }
  .brand small,
  .school,
  .aside-footer {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 5px;
    margin-top: 18px;
  }
  nav button {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 10px;
  }
  .brand {
    font-size: 1rem;
  }
  main {
    padding: 24px 16px;
  }
  .stats {
    gap: 10px;
  }
  .stat,
  .card {
    min-width: 0;
    padding: 18px;
  }
  .stat strong {
    font-size: 1.5rem;
  }
  h1 {
    font-size: 1.65rem;
  }
  .local-label {
    display: none;
  }
  .grid {
    gap: 16px;
  }
  .rule-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toolbar input {
    min-width: 180px;
    width: 100%;
  }
  .toolbar label {
    flex: 1;
  }
  .card-head {
    flex-wrap: wrap;
  }
  .lab-frame {
    height: 520px;
  }
  .notice {
    font-size: 0.85rem;
  }
}
#content > .card + .card {
  margin-top: 24px;
}
#lab-active {
  margin: 24px 0;
}
@media (max-width: 480px) {
  .stats, .rule-grid { grid-template-columns: minmax(0, 1fr); }
  .job-row { flex-wrap: wrap; }
  .pill { white-space: normal; }
}
.description-cell{white-space:normal;min-width:220px;max-width:420px;line-height:1.5}
.shell[hidden],
#account-screen[hidden] {
  display: none;
}

.account-screen {
  width: min(100% - 2rem, 29rem);
  margin: clamp(2rem, 12vh, 8rem) auto;
}

.account-screen form,
.account-screen label {
  display: grid;
  gap: 0.6rem;
}

.account-screen form {
  gap: 1rem;
}

.account-screen input {
  width: 100%;
}

#account-actions {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

#account-actions button {
  text-align: left;
}
