:root {
  color-scheme: light;
  --navy: #203847;
  --navy-2: #152b38;
  --teal: #1f9d83;
  --amber: #f6b31a;
  --blue: #1d6fb6;
  --paper: #f5f8f8;
  --panel: #ffffff;
  --ink: #172631;
  --muted: #637783;
  --line: #dce7e8;
  --line-strong: #c4d4d7;
  --good: #1f845d;
  --warn: #a25f00;
  --danger: #b83d3d;
  --shadow: 0 18px 40px rgba(21, 43, 56, 0.13);
  --shadow-soft: 0 10px 24px rgba(21, 43, 56, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(246, 179, 26, 0.12), rgba(31, 157, 131, 0.1), rgba(29, 111, 182, 0.12)) 0 0 / 100% 8px no-repeat,
    linear-gradient(135deg, #fbfcfb 0%, #f4f9f8 46%, #edf5fb 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--blue);
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(21, 43, 56, 0.18);
}

button:hover,
.button-link:hover {
  background: var(--navy-2);
}

.button-link.secondary {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--navy);
  box-shadow: none;
}

.button-link.secondary:hover {
  background: #f0f5f5;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #8f2f2f;
}

button:disabled {
  background: #aeb9bd;
  box-shadow: none;
  cursor: not-allowed;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 157, 131, 0.16);
}

textarea {
  resize: vertical;
}

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

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

th {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:hover {
  background: #f7fbfb;
}

code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #edf4f4;
  color: var(--navy);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 10px 28px;
  border-bottom: 1px solid rgba(220, 231, 232, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(21, 43, 56, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}

.brand-logo {
  width: 54px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.brand-text {
  display: grid;
  gap: 0;
  line-height: 1.05;
}

.brand-text strong {
  color: var(--navy);
  font-size: 1.15rem;
}

.brand-text span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar nav > a {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.topbar nav > a:hover {
  background: #eef6f6;
}

.topbar form {
  margin: 0;
}

.ghost {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--navy);
  box-shadow: none;
}

.ghost:hover {
  background: #f0f5f5;
}

@media (min-width: 901px) {
  .topbar {
    position: fixed;
    inset: 0 auto 0 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 250px;
    height: 100vh;
    padding: 24px 16px;
    border-right: 1px solid rgba(220, 231, 232, 0.9);
    border-bottom: 0;
    background: var(--navy);
    box-shadow: 12px 0 34px rgba(21, 43, 56, 0.2);
  }

  .topbar .brand {
    padding: 0 6px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
  }

  .topbar .brand-text strong,
  .topbar .brand-text span {
    color: #fff;
  }

  .topbar nav {
    flex: 1;
    align-items: stretch;
    flex-direction: column;
    padding-top: 18px;
  }

  .topbar nav > a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 12px;
    color: #fff;
  }

  .topbar nav > a:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .topbar nav form {
    margin-top: auto;
  }

  .topbar nav button {
    width: 100%;
  }

  .topbar .ghost {
    border-color: rgba(255, 255, 255, 0.42);
    background: transparent;
    color: #fff;
  }

  .topbar .ghost:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .topbar + .container {
    width: min(1180px, calc(100% - 298px));
    margin-right: 24px;
    margin-left: 274px;
  }
}

.container {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.panel,
.course-card {
  border: 1px solid rgba(220, 231, 232, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.login-page {
  background: #102936;
}

.login-main {
  min-height: 100vh;
}

.hub-login {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(500px, 2fr);
  min-height: 100vh;
}

.login-story {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  padding: clamp(34px, 6vw, 84px);
  background: #173140 url('/assets/mud-engineer-login-bg.jpg') center / cover no-repeat;
}

.login-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(11, 31, 42, 0.48);
}

.login-story-content {
  width: min(720px, 100%);
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.hub-kicker {
  margin: 0 0 16px;
  color: #c9f0e6;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.login-story h1 {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem, 5vw, 5.4rem);
  line-height: 0.98;
}

.login-story-content > p:not(.hub-kicker) {
  max-width: 580px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
}

.hub-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 28px;
}

.hub-modules span {
  padding: 4px 18px;
  border-left: 2px solid var(--amber);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hub-modules span:first-child {
  padding-left: 0;
  border-left: 0;
}

.login-access {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(30px, 3.5vw, 52px);
  border-left: 1px solid #d8e4e2;
  background: #f4f8f7;
}

.login-access-inner {
  width: min(430px, 100%);
}

.login-logo {
  display: block;
  width: min(230px, 68%);
  max-height: 108px;
  margin: 0 0 30px;
  object-fit: contain;
  object-position: left center;
}

.hub-title {
  margin-bottom: 28px;
}

.hub-title h2 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: clamp(2rem, 2.6vw, 2.65rem);
  line-height: 1.02;
}

.hub-title > p:last-child,
.login-footnote {
  color: var(--muted);
}

.login-form {
  gap: 18px;
}

.login-form input {
  min-height: 52px;
  border-color: #b9cdcf;
  background: #fff;
}

.login-form button {
  min-height: 52px;
  margin-top: 4px;
  background: var(--navy);
}

.login-footnote {
  margin: 22px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.panel {
  padding: 22px;
}

.compact {
  min-width: 190px;
  text-align: right;
}

.form-panel {
  max-width: 760px;
}

.page-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.page-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: min(240px, 46%);
  height: 3px;
  background: linear-gradient(90deg, var(--amber), var(--teal), var(--blue));
}

.page-head.smaller {
  margin-top: 36px;
}

.page-head h1,
.panel h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.panel h2,
.course-card h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.22rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.error,
.warning {
  color: var(--danger);
  font-weight: 800;
}

.success {
  color: var(--good);
  font-weight: 800;
}

.action-row,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.link-row a {
  font-weight: 800;
}

.inline-form {
  display: inline;
  margin: 0;
}

button.text-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--blue);
  font-weight: 800;
}

button.text-button:hover {
  background: transparent;
  text-decoration: underline;
}

button.danger-text,
button.danger-text:hover {
  color: var(--danger);
}

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

.course-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 22px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.course-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--amber), var(--teal), var(--blue));
}

.course-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4f4;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.pill.good {
  background: #e3f5ed;
  color: var(--good);
}

.pill.warn {
  background: #fff2d8;
  color: var(--warn);
}

.pill.bad {
  background: #fff0ee;
  color: var(--danger);
}

.pill.muted-status {
  background: #eef2f3;
  color: var(--muted);
}

.certificate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.certificate-card {
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.certificate-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.certificate-card-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.25rem;
}

.certificate-photo,
.certificate-placeholder {
  width: 100%;
  aspect-ratio: 1.58 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #edf3f4;
}

.certificate-photo {
  display: block;
  object-fit: contain;
}

.certificate-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.certificate-note {
  min-height: 48px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.certificate-form {
  margin-top: 16px;
}

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

.certificate-file-control {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 2px 12px;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px dashed #8eaaaf;
  border-radius: 6px;
  background: #f7fbfb;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.certificate-action-icon {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: 6px;
  background: var(--navy);
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.storage-control .certificate-action-icon {
  background: var(--blue);
}

.certificate-file-control:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
  background: #eef8f6;
}

.certificate-file-control > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  opacity: 0;
}

.certificate-file-control > span {
  align-self: end;
  font-weight: 900;
}

.certificate-file-control > small {
  align-self: start;
  color: var(--muted);
}

.certificate-upload-note {
  margin: -4px 2px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.certificate-processing {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border-left: 4px solid var(--teal);
  background: #e9f7f3;
  color: var(--navy);
}

.certificate-processing[hidden] {
  display: none;
}

.certificate-processing span:last-child {
  display: grid;
}

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

.expiry-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0 30px;
}

.expiry-alert-panel {
  padding: 0;
  overflow: hidden;
}

.expiry-alert-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.expired-panel .expiry-alert-heading {
  border-top: 4px solid var(--danger);
  background: #fff7f6;
}

.expiring-panel .expiry-alert-heading {
  border-top: 4px solid var(--amber);
  background: #fffaf0;
}

.expiry-alert-heading h2 {
  margin: 2px 0 0;
  color: var(--navy);
  font-size: 1.25rem;
}

.expiry-count {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
}

.expiry-alert-list {
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.expiry-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.expiry-alert-item:last-child {
  border-bottom: 0;
}

.expiry-alert-item > div {
  display: grid;
  gap: 3px;
}

.expiry-alert-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.expiry-alert-date {
  justify-items: end;
  flex: 0 0 auto;
}

.expiry-alert-date time {
  color: var(--navy);
  font-weight: 900;
}

.expiry-alert-empty {
  padding: 24px 20px;
  color: var(--muted);
}

.certificate-register-heading {
  margin-top: 4px;
}

.processing-spinner {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(31, 157, 131, 0.22);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: certificate-spin 700ms linear infinite;
}

.certificate-card.is-processing .certificate-file-control,
.certificate-card.is-processing .date-fields,
.certificate-card.is-processing .certificate-awaiting {
  opacity: 0.42;
  pointer-events: none;
}

.certificate-awaiting {
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: #fff8e8;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes certificate-spin {
  to { transform: rotate(360deg); }
}

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

.certificate-dates {
  display: block;
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.certificate-date-source {
  display: block;
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-certificate-form {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.admin-certificate-form label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-certificate-form input {
  min-height: 38px;
  margin-top: 3px;
  padding: 7px 8px;
}

.admin-certificate-form button,
.certificate-admin-actions button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.certificate-admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.certificate-admin-actions form {
  margin: 0;
}

.date-fields input[readonly] {
  background: #eef3f4;
  color: var(--navy);
  cursor: not-allowed;
}

.certificate-status-table td:not(:first-child) {
  min-width: 180px;
  vertical-align: top;
}

.stack {
  display: grid;
  gap: 16px;
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.table-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.table-form input {
  width: min(180px, 100%);
  margin-top: 0;
}

.table-form button {
  min-height: 38px;
  padding: 0 12px;
}

.email-form input {
  width: min(240px, 100%);
}

.email-warning {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
}

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

.stat-card {
  text-align: left;
}

.table-panel {
  overflow-x: auto;
}

[hidden] {
  display: none !important;
}

.table-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.table-search {
  display: block;
  width: min(520px, 100%);
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 900;
}

.table-search input {
  padding-left: 42px;
  background-color: #fff;
  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='%23637783' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-position: 13px center;
  background-repeat: no-repeat;
}

.table-result-count {
  flex: none;
  padding-bottom: 11px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.table-empty-filter td {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.password-reset-form {
  align-items: stretch;
}

.password-reset-control {
  position: relative;
  display: block;
  width: min(240px, 100%);
}

.password-reset-control input {
  width: 100%;
  padding-right: 62px;
}

.password-reset-control .password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: auto;
  min-height: 36px;
  padding: 0 10px;
  background: transparent;
  color: var(--blue);
  box-shadow: none;
  font-size: 0.78rem;
}

.password-reset-control .password-toggle:hover {
  background: #edf5fb;
}

.import-result {
  margin-bottom: 18px;
}

.password-security-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
  background: #edf5fb;
  color: var(--navy);
  font-size: 0.9rem;
}

.demo-box {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbfb;
  color: var(--muted);
  font-size: 0.93rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 18px;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  color: var(--blue);
}

.video-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy-2);
  box-shadow: var(--shadow);
}

.video-frame video {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #0f1f29;
}

.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: #fff;
}

.missing-video {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.quiz-lock {
  margin-top: 18px;
}

.quiz-form {
  display: grid;
  gap: 16px;
}

.question {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.question legend {
  padding: 0 6px;
  color: var(--navy);
  font-weight: 900;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
}

.choice input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.result {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 8px;
}

.result.pass {
  border: 1px solid #9ed6bc;
  background: #e7f6ee;
}

.result.fail {
  border: 1px solid #e2b1a9;
  background: #fff0ee;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
}

.import-layout {
  align-items: start;
}

.question-admin {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.question-admin h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1rem;
}

.question-admin-head,
.question-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.question-actions {
  flex: 0 0 auto;
}

.question-actions a {
  font-weight: 800;
}

.metric {
  display: block;
  color: var(--navy);
  font-size: 2rem;
  font-weight: 900;
}

@media (max-width: 900px) {
  .hub-login {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 30vh;
    padding: 34px 28px;
    background-position: 38% center;
  }

  .login-story h1 {
    max-width: 600px;
    font-size: clamp(2.2rem, 8vw, 4rem);
  }

  .login-story-content > p:not(.hub-kicker),
  .hub-modules {
    display: none;
  }

  .login-access {
    min-height: 70vh;
    place-items: start center;
    padding: 30px 28px 42px;
    border-top: 5px solid var(--teal);
    border-left: 0;
  }

  .login-logo {
    width: min(210px, 64%);
    max-height: 100px;
    margin-bottom: 24px;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .topbar,
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
    gap: 12px;
    padding: 12px;
  }

  .topbar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .topbar nav > a,
  .topbar nav form,
  .topbar nav button {
    width: 100%;
  }

  .topbar nav > a,
  .topbar nav button {
    min-height: 46px;
    padding: 8px;
    text-align: center;
  }

  .brand-logo {
    width: 48px;
    height: 38px;
  }

  .brand-text span {
    display: none;
  }

  .compact {
    text-align: left;
  }

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

  .container {
    width: min(100% - 24px, 680px);
    padding: 22px 0 44px;
  }

  .panel,
  .certificate-card {
    padding: 16px;
  }

  .page-head {
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 16px;
  }

  .page-head h1,
  .panel h1 {
    font-size: 2rem;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .action-row > *,
  .form-panel form > button,
  .certificate-form > button {
    width: 100%;
  }

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

  .certificate-card-head {
    flex-wrap: wrap;
  }

  .certificate-upload-actions {
    grid-template-columns: 1fr;
  }

  .certificate-file-control {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 78px;
    padding: 12px;
  }

  .certificate-action-icon {
    width: 38px;
    height: 38px;
  }

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

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

  .expiry-alert-item {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .date-fields input {
    min-width: 0;
  }

  .stack {
    gap: 14px;
  }

  input,
  textarea,
  select,
  button,
  .button-link {
    min-height: 48px;
  }

  .login-story {
    min-height: 24vh;
    padding: 24px 22px;
  }

  .login-story h1 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .login-access {
    min-height: 76vh;
    padding: 24px 22px 36px;
  }

  .login-logo {
    width: min(185px, 58%);
    max-height: 88px;
    margin-bottom: 18px;
  }

  .hub-title {
    margin-bottom: 20px;
  }

  .hub-title h2 {
    font-size: 1.8rem;
  }

  .login-form {
    gap: 14px;
  }

  .login-form input,
  .login-form button {
    min-height: 48px;
  }

  .responsive-table {
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .responsive-table table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody {
    display: grid;
    gap: 12px;
  }

  .responsive-table tr {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .responsive-table td,
  .certificate-status-table td:not(:first-child) {
    display: grid;
    grid-template-columns: minmax(100px, 34%) minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  .responsive-table td:last-child {
    border-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--navy);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .table-form {
    align-items: stretch;
    flex-direction: column;
  }

  .table-form input {
    width: 100%;
  }

  .table-form button {
    width: 100%;
  }

  .table-tools {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .table-search {
    width: 100%;
  }

  .table-result-count {
    padding: 0;
  }

  .password-reset-control {
    width: 100%;
  }

  .password-reset-control .password-toggle {
    width: auto;
  }
}

@media (max-width: 430px) {
  .responsive-table td,
  .certificate-status-table td:not(:first-child) {
    display: block;
  }

  .responsive-table td::before {
    display: block;
    margin-bottom: 6px;
  }
}
