:root {
  color-scheme: light;
  --bg: #eef3f9;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --surface-strong: #dfe8f5;
  --text: #10233f;
  --muted: #59708f;
  --line: #c7d4e5;
  --navy: #0a1b37;
  --navy-soft: #12305d;
  --blue: #1877ff;
  --blue-strong: #0f5dd3;
  --blue-glow: rgba(24, 119, 255, 0.18);
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --warning: #9a6700;
  --warning-bg: #fff8e1;
  --success: #0f766e;
  --success-bg: #e7f8f6;
  --shadow: 0 18px 54px rgba(10, 27, 55, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #f5f8fc 0%, #e9f0f9 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(24, 119, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #f5f8fc 0%, #e9f0f9 100%);
}

body.page-splash {
  overflow-x: hidden;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(24, 119, 255, 0.35);
  outline-offset: 2px;
}

.page-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.layout-shell {
  display: grid;
  gap: 20px;
}

.narrow-shell {
  max-width: 760px;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(199, 212, 229, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card,
.report-shell,
.tracking-card,
.tracking-summary-card,
.timeline-card,
.auth-card,
.success-card,
.info-card {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-strong);
}

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

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

.lead {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.wrap-text {
  word-break: break-word;
}

.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;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 20px;
}

.info-grid {
  display: grid;
  gap: 16px;
}

.subtle-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 245, 253, 0.96));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

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

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, #3ca2ff 100%);
  box-shadow: 0 12px 24px rgba(24, 119, 255, 0.24);
}

.btn-primary[disabled],
.btn-primary.is-loading {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.btn-secondary {
  color: var(--navy);
  background: #e8f0fb;
}

.btn-ghost {
  color: var(--navy);
  background: transparent;
  border: 1px solid var(--line);
}

.btn-lg {
  min-width: 170px;
}

.btn-block {
  width: 100%;
}

.text-link {
  color: var(--blue-strong);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.flash-stack {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: min(100% - 24px, 760px);
  margin: 12px auto 0;
}

.inline-flash {
  position: static;
  width: 100%;
  margin: 0;
}

.flash,
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  line-height: 1.55;
}

.flash-warning {
  background: var(--warning-bg);
  border-color: #f2d88a;
  color: var(--warning);
}

.flash-error,
.alert-danger {
  background: var(--danger-bg);
  border-color: #f4b4ad;
  color: var(--danger);
}

.alert-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

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

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

.field span,
.summary-grid dt {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.field textarea {
  min-height: 136px;
  resize: vertical;
}

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

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

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

.stepper {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.step-pill {
  padding: 12px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf3fb;
  border: 1px solid transparent;
  font-weight: 700;
  text-align: center;
}

.step-pill.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-strong) 100%);
  border-color: rgba(255, 255, 255, 0.22);
}

.report-step {
  display: grid;
  gap: 18px;
}

.upload-card,
.confirmation-card {
  display: grid;
  gap: 14px;
}

.upload-dropzone {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 22px;
  border: 1.5px dashed #7ea7e8;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(232, 240, 251, 0.85), rgba(255, 255, 255, 0.95));
}

.upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.upload-title {
  font-weight: 800;
}

.upload-copy,
.upload-hint {
  color: var(--muted);
}

.photo-preview-grid {
  display: grid;
  gap: 12px;
}

.photo-preview-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.photo-preview-card img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.photo-preview-meta {
  min-width: 0;
}

.photo-preview-meta strong,
.photo-preview-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-preview-remove {
  min-height: 44px;
  padding: 0 14px;
  color: var(--danger);
  background: #fff;
  border: 1px solid #efc0ba;
  border-radius: 999px;
}

.summary-grid {
  display: grid;
  gap: 14px;
}

.summary-grid div {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.summary-grid dd {
  margin: 8px 0 0;
  line-height: 1.6;
  white-space: pre-line;
}

.compact-grid dd {
  white-space: normal;
}

.tracking-feedback-card,
.feedback-card {
  padding: 24px;
}

.feedback-card {
  display: grid;
  gap: 20px;
}

.feedback-fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
}

.feedback-fieldset legend {
  padding: 0;
  font-weight: 700;
  line-height: 1.6;
}

.feedback-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feedback-stars label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(24, 119, 255, 0.14);
  background: var(--surface-soft);
  color: #b8c6d9;
  font-size: 2rem;
  transition: transform 0.18s ease, color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.feedback-stars label:hover,
.feedback-stars label:hover ~ label,
.feedback-stars input:checked + label,
.feedback-stars input:checked + label ~ label {
  color: #f4b400;
  background: rgba(24, 119, 255, 0.08);
}

.feedback-stars label:hover {
  transform: translateY(-1px);
}

.feedback-stars input:focus-visible + label {
  outline: 3px solid rgba(24, 119, 255, 0.35);
  outline-offset: 2px;
}

.feedback-rating-legend {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.feedback-result {
  display: grid;
  gap: 14px;
}

.feedback-rating-display {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.feedback-rating-display strong {
  font-size: clamp(1.7rem, 6vw, 2.5rem);
  letter-spacing: 0.06em;
  color: #f4b400;
}

.feedback-rating-display span {
  font-weight: 700;
}

.form-actions {
  justify-content: space-between;
  margin-top: 24px;
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(24, 119, 255, 0.12);
  color: var(--blue-strong);
}

.success-badge {
  background: var(--success-bg);
  color: var(--success);
}

.status-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.status-meta {
  color: var(--muted);
  font-weight: 600;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 14px;
  align-items: start;
}

.timeline-dot {
  position: relative;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--blue) 0%, var(--navy) 100%);
  box-shadow: 0 0 0 6px rgba(24, 119, 255, 0.1);
}

.timeline-item:not(:last-child) .timeline-dot::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  width: 2px;
  height: calc(100% + 14px);
  background: linear-gradient(180deg, rgba(24, 119, 255, 0.35), rgba(16, 35, 63, 0.08));
}

.timeline-content {
  display: grid;
  gap: 4px;
}

.timeline-content span {
  color: var(--muted);
}

.splash-screen {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.splash-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 35, 63, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 63, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 88%);
}

.splash-card-premium {
  position: relative;
  z-index: 1;
  width: min(100%, 920px);
  display: grid;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid rgba(104, 141, 197, 0.24);
  background:
    linear-gradient(155deg, rgba(7, 18, 38, 0.98) 0%, rgba(10, 27, 55, 0.96) 58%, rgba(13, 46, 89, 0.94) 100%);
  color: #fff;
  box-shadow: 0 28px 80px rgba(10, 27, 55, 0.34);
}

.splash-visual {
  position: relative;
  display: grid;
  min-height: 320px;
  align-items: center;
}

.splash-asset-frame {
  position: relative;
  min-height: 320px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 70% 30%, rgba(24, 119, 255, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(13, 46, 89, 0.46), rgba(7, 18, 38, 0.18));
  overflow: hidden;
}

.splash-glow {
  position: absolute;
  inset: auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 119, 255, 0.38), rgba(24, 119, 255, 0));
  filter: blur(8px);
}

.splash-glow-left {
  left: -24px;
  bottom: -18px;
}

.splash-glow-right {
  right: -12px;
  top: -10px;
}

.splash-factory-line {
  position: absolute;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(142, 185, 255, 0.55), rgba(255, 255, 255, 0));
}

.splash-factory-line-top {
  top: 82px;
}

.splash-factory-line-bottom {
  bottom: 78px;
}

.splash-gear-shell {
  position: absolute;
  right: -18px;
  top: 30px;
  width: clamp(190px, 46vw, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 119, 255, 0.22), rgba(24, 119, 255, 0.02));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 50px rgba(24, 119, 255, 0.16);
}

.gear-svg {
  fill: #eaf4ff;
}

.gear-svg-large {
  width: 100%;
  height: 100%;
  opacity: 0.88;
}

.gear-ring {
  fill: none;
  stroke: rgba(234, 244, 255, 0.36);
  stroke-width: 8;
}

.gear-core {
  transform-origin: 110px 110px;
  animation: rotate-gear 12s linear infinite;
}

.technician-figure {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 170px;
  height: 250px;
  transform: translateX(-50%);
}

.technician-helmet,
.technician-head,
.technician-body,
.technician-arm,
.technician-tool {
  position: absolute;
}

.technician-helmet {
  left: 48px;
  top: 10px;
  width: 74px;
  height: 40px;
  border-radius: 44px 44px 18px 18px;
  background: linear-gradient(180deg, #d8e4f3 0%, #8aa5c7 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.technician-head {
  left: 56px;
  top: 36px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, #91a8c7 0%, #5f7392 100%);
}

.technician-body {
  left: 32px;
  top: 76px;
  width: 106px;
  height: 138px;
  border-radius: 34px 34px 24px 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, #3f78d7 0%, #18488d 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.technician-body::before,
.technician-body::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 14px;
  width: 8px;
  border-radius: 999px;
  background: rgba(222, 238, 255, 0.22);
}

.technician-body::before {
  left: 20px;
}

.technician-body::after {
  right: 20px;
}

.technician-arm {
  width: 28px;
  height: 112px;
  border-radius: 18px;
  background: linear-gradient(180deg, #225aaf 0%, #163f79 100%);
}

.technician-arm-left {
  left: 18px;
  top: 92px;
  transform: rotate(16deg);
}

.technician-arm-right {
  right: 20px;
  top: 92px;
  transform: rotate(-30deg);
}

.technician-tool {
  right: -4px;
  top: 146px;
  width: 56px;
  height: 18px;
  border-radius: 10px;
  background: linear-gradient(90deg, #d5dfec 0%, #90a3bc 100%);
  transform: rotate(-32deg);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.technician-tool::before,
.technician-tool::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 4px solid #d5dfec;
  border-radius: 50%;
  transform: translateY(-50%);
}

.technician-tool::before {
  left: -8px;
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.technician-tool::after {
  right: -8px;
  border-left-color: transparent;
  border-top-color: transparent;
}

.splash-content {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 14px;
}

.brand-mark {
  font-weight: 800;
  letter-spacing: 0.12em;
}

.splash-subtitle {
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.05rem;
}

.staff-app-shell {
  min-height: 100vh;
  padding-bottom: 92px;
}

.staff-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  padding: 18px 16px 14px;
  background: rgba(245, 248, 252, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(199, 212, 229, 0.85);
}

.staff-topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.staff-page-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.staff-topbar-subtitle {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  flex-wrap: wrap;
}

.staff-page-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 20px 16px 120px;
  display: grid;
  gap: 18px;
}

.staff-page-intro {
  padding: 16px 18px;
}

.staff-page-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.notification-bell {
  position: relative;
  min-width: 52px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(199, 212, 229, 0.9);
  box-shadow: 0 12px 28px rgba(10, 27, 55, 0.1);
}

.notification-badge,
.staff-nav-badge {
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff8b4d 0%, #f04438 100%);
  font-size: 0.75rem;
  font-weight: 800;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
}

.staff-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10, 27, 55, 0.96);
  box-shadow: 0 -14px 32px rgba(10, 27, 55, 0.2);
}

.staff-nav-link {
  min-height: 52px;
  padding: 10px 8px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  border-radius: 18px;
  text-align: center;
  font-weight: 700;
}

.staff-bottom-nav--management {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding-left: 8px;
  padding-right: 8px;
}

.staff-bottom-nav--management .staff-nav-link {
  padding: 8px 4px;
  font-size: 0.85rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.staff-nav-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(24, 119, 255, 0.28), rgba(60, 162, 255, 0.18));
}

.staff-count-grid,
.staff-job-grid,
.staff-photo-grid,
.staff-notification-list {
  display: grid;
  gap: 14px;
}

.staff-count-card,
.staff-empty-card,
.staff-detail-card,
.notification-card,
.job-card {
  padding: 20px;
}

.management-toolbar-card,
.management-kpi-card,
.management-metric-card,
.performance-card,
.history-result-card {
  padding: 20px;
}

.staff-count-card span {
  color: var(--muted);
  font-weight: 700;
}

.staff-count-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.staff-section {
  display: grid;
  gap: 14px;
}

.management-toolbar-actions,
.management-drilldown-head,
.management-pagination,
.management-pagination-actions,
.performance-card-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.period-chip-row,
.choice-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.period-chip input,
.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.period-chip span,
.choice-chip span {
  min-height: 44px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.period-chip input:checked + span,
.choice-chip input:checked + span {
  border-color: rgba(24, 119, 255, 0.48);
  background: rgba(24, 119, 255, 0.12);
  color: var(--brand-primary);
}

.management-inline-note,
.management-period-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.management-date-grid,
.history-filter-grid,
.history-result-meta,
.performance-metric-grid {
  display: grid;
  gap: 12px;
}

.management-card-grid,
.performance-card-grid,
.history-result-grid {
  display: grid;
  gap: 14px;
}

.management-kpi-card,
.management-metric-card,
.performance-card,
.history-result-card {
  display: grid;
  gap: 14px;
}

.management-card-grid > *,
.performance-card-grid > *,
.history-result-grid > *,
.management-drilldown-head > * {
  min-width: 0;
}

.management-kpi-card,
.management-metric-card,
.performance-card,
.history-result-card,
.management-drilldown-head {
  overflow-wrap: anywhere;
}

.management-kpi-head,
.performance-card h3 {
  margin: 0;
}

.management-kpi-value,
.management-metric-value {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.management-filter-panel {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.management-filter-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.management-choice-group {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 10px;
}

.management-choice-group legend {
  padding: 0;
  font-weight: 800;
  margin-bottom: 2px;
}

.performance-metric-grid,
.history-result-meta {
  margin: 0;
}

.performance-metric-grid div,
.history-result-meta div {
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.performance-metric-grid dd,
.history-result-meta dd {
  margin: 6px 0 0;
}

.job-card {
  display: grid;
  gap: 14px;
}

.job-card.is-urgent {
  border-color: rgba(255, 139, 77, 0.55);
  box-shadow: 0 18px 54px rgba(255, 139, 77, 0.12);
}

.job-card-head,
.notification-card-head,
.notification-card-actions,
.job-card-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.job-card-meta {
  display: grid;
  gap: 10px;
}

.job-card-meta div {
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.job-card-meta dd {
  margin: 6px 0 0;
}

.job-card-problem {
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-line;
}

.staff-photo-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.staff-photo-card {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.staff-photo-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.staff-photo-card figcaption {
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.staff-sticky-actions {
  position: sticky;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  background: rgba(245, 248, 252, 0.94);
  border: 1px solid rgba(199, 212, 229, 0.8);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 42px rgba(10, 27, 55, 0.14);
}

.staff-sticky-actions form {
  display: contents;
}

.staff-sticky-actions .btn {
  flex: 1 1 180px;
}

.action-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.action-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 27, 55, 0.42);
}

.action-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 16px;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 -18px 44px rgba(10, 27, 55, 0.22);
  max-height: 88vh;
  overflow: auto;
}

.action-sheet-close {
  justify-self: end;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.notification-card.is-unread {
  border-color: rgba(24, 119, 255, 0.4);
  box-shadow: 0 18px 54px rgba(24, 119, 255, 0.12);
}

.profile-logout-form {
  margin-top: 20px;
}

body.has-sheet-open {
  overflow: hidden;
}

@keyframes rotate-gear {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 720px) {
  .page-shell {
    padding: 36px 24px 56px;
  }

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

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

  .splash-card-premium {
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    align-items: center;
  }

  .staff-page-shell {
    padding: 28px 24px 120px;
  }

  .staff-count-grid,
  .staff-job-grid,
  .staff-notification-list,
  .management-card-grid,
  .history-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-filter-grid,
  .management-date-grid,
  .history-result-meta,
  .performance-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 719px) {
  .section-head,
  .form-actions,
  .photo-preview-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-actions .btn,
  .form-actions .btn,
  .splash-content .btn {
    width: 100%;
  }

  .photo-preview-card {
    justify-items: start;
  }

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

  .staff-bottom-nav {
    gap: 6px;
  }

  .staff-nav-link {
    font-size: 0.82rem;
  }

  .management-toolbar-actions .btn,
  .management-pagination-actions .btn {
    width: 100%;
  }

  .technician-figure {
    left: 46%;
    bottom: 18px;
    width: 150px;
    height: 226px;
  }

  .splash-gear-shell {
    right: -26px;
    top: 20px;
    width: clamp(180px, 58vw, 240px);
  }

  .splash-asset-frame {
    min-height: 290px;
  }

  .splash-content {
    justify-items: stretch;
  }
}

@media (max-width: 420px) {
  .page-shell {
    padding-inline: 12px;
  }

  .card,
  .hero-card,
  .report-shell,
  .tracking-card,
  .tracking-summary-card,
  .timeline-card,
  .auth-card,
  .success-card,
  .info-card {
    border-radius: 24px;
  }

  .splash-card-premium {
    padding: 20px;
  }

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

  .technician-figure {
    left: 48%;
    width: 136px;
    height: 210px;
  }

  .technician-helmet {
    left: 39px;
    width: 60px;
    height: 34px;
  }

  .technician-head {
    left: 46px;
    top: 32px;
    width: 48px;
    height: 48px;
  }

  .technician-body {
    left: 24px;
    top: 68px;
    width: 88px;
    height: 120px;
  }

  .technician-arm {
    height: 96px;
  }

  .technician-arm-left {
    left: 12px;
    top: 84px;
  }

  .technician-arm-right {
    right: 12px;
    top: 86px;
  }

  .technician-tool {
    right: -4px;
    top: 132px;
    width: 48px;
  }

  .summary-grid div,
  .performance-metric-grid div,
  .history-result-meta div,
  .field input,
  .field select,
  .field textarea {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .gear-core {
    animation: none;
  }

  .btn,
  .btn:hover {
    transition: none;
    transform: none;
  }
}

/* ==========================================================================
   M2-008C release UI polish (appended; overrides earlier rules by source order)
   ========================================================================== */

/* The HTML hidden attribute must always win over component display rules
   (e.g. .report-step { display: grid } previously showed every report step). */
[hidden] {
  display: none !important;
}

:root {
  --muted: #4a6182;
  --amber: #8a5300;
  --amber-bg: #fff3d6;
  --amber-line: #efc15a;
  --orange: #b54708;
  --orange-bg: #fff0e1;
  --orange-line: #f5b07a;
  --critical: #b42318;
  --green: #1d6b3a;
  --green-bg: #e2f4e8;
  --green-line: #9ed2ae;
  --teal: #0f766e;
  --teal-bg: #e1f6f2;
  --teal-line: #8ed6c9;
  --reopen: #6b3fa0;
  --reopen-bg: #f3ecfb;
}

.nowrap {
  white-space: nowrap;
}

.required-mark {
  color: var(--danger);
  font-style: normal;
  font-weight: 800;
}

.optional-mark {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
  font-size: 0.88em;
}

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

.btn-sm {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.95rem;
}

/* ---- Semantic status badges (colour + text + marker) ---- */
.status-badge {
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  white-space: nowrap;
  font-size: 0.9rem;
}

.status-badge[data-status]::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-reported {
  color: var(--navy-soft);
  background: #e3e9f4;
  border-color: #b8c6dd;
}

.status-accepted {
  color: var(--blue-strong);
  background: #fff;
  border-color: #8db8ff;
}

.status-in_progress {
  color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-strong) 100%);
}

.status-waiting_parts {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-line);
}

.status-waiting_parts[data-status]::before {
  border-radius: 2px;
}

.status-completed {
  color: var(--teal);
  background: var(--teal-bg);
  border-color: var(--teal-line);
}

.status-closed {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-line);
}

.status-closed[data-status]::before {
  content: "✓";
  width: auto;
  height: auto;
  background: none;
  font-weight: 900;
}

/* ---- Priority badges (text + colour + marker) ---- */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.priority-normal {
  color: #3f5475;
  background: #f1f4f9;
  border-color: #d3dcea;
  font-weight: 700;
}

.priority-urgent {
  color: var(--orange);
  background: var(--orange-bg);
  border-color: var(--orange-line);
}

.priority-urgent::before {
  content: "!";
  font-weight: 900;
}

.priority-critical {
  color: #fff;
  background: var(--critical);
  border-color: var(--critical);
}

.priority-critical::before {
  content: "!!";
  font-weight: 900;
}

.context-badge,
.age-chip,
.period-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.context-badge {
  color: var(--reopen);
  background: var(--reopen-bg);
  border: 1px solid #d6c3ef;
}

.age-chip,
.period-tag {
  color: #2f4668;
  background: #eaf0f8;
}

/* ---- Dashboard count tiles: compact 2x2 on phones ---- */
.staff-count-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.staff-count-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  border-left: 5px solid var(--line);
}

.staff-count-card strong {
  margin-top: 2px;
  font-size: 1.75rem;
  line-height: 1.1;
}

.staff-count-card.tone-reported { border-left-color: var(--navy-soft); }
.staff-count-card.tone-in_progress { border-left-color: var(--blue); }
.staff-count-card.tone-waiting_parts { border-left-color: var(--amber-line); }
.staff-count-card.tone-closed { border-left-color: var(--green-line); }

.staff-count-card.is-priority {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border-left-color: var(--teal);
  background: linear-gradient(135deg, var(--teal-bg) 0%, #fff 100%);
}

.staff-count-card.is-priority span {
  color: var(--teal);
  font-size: 1.05rem;
  font-weight: 800;
}

.section-count {
  color: var(--muted);
  font-size: 0.9em;
  font-weight: 700;
}

.staff-section {
  scroll-margin-top: 12px;
}

/* ---- Compact job / history cards ---- */
.job-card--compact,
.history-result-card--compact {
  gap: 8px;
  padding: 16px;
}

.job-card--compact.is-urgent {
  border-left: 5px solid var(--critical);
}

.job-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 10px;
}

.job-card-no {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.job-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-card-equipment {
  margin: 2px 0 0;
  font-size: 1.02rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.job-card-where {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.job-card--compact .job-card-problem,
.history-result-card--compact .job-card-problem {
  margin: 0;
  color: var(--text);
  white-space: normal;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.job-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.job-card-time,
.history-inline-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.history-inline-meta span {
  color: var(--text);
  font-weight: 700;
}

/* ---- Work-order detail: key facts first ---- */
.wo-hero {
  display: grid;
  gap: 12px;
}

.wo-hero-no {
  margin: 0;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.wo-key-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.wo-key-facts div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.wo-key-facts dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.wo-key-facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.wo-key-facts dd.wo-equipment {
  font-size: 1.12rem;
  font-weight: 800;
}

.wo-problem {
  padding: 10px 12px;
  border: 1px solid #dfe7f2;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.state-banner {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: var(--radius-md);
}

.state-banner--waiting {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-line);
}

.state-banner--completed {
  color: var(--teal);
  background: var(--teal-bg);
  border-color: var(--teal-line);
}

.state-banner--closed {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-line);
}

.wo-more > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-weight: 800;
}

.wo-more[open] > summary {
  margin-bottom: 8px;
}

/* ---- Action sheets ---- */
.action-sheet-close {
  min-height: 44px;
  font-weight: 700;
}

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

.upload-dropzone--compact {
  padding: 16px;
}

.action-sheet .field textarea {
  min-height: 88px;
}

/* ---- Quick Report stepper: compact numbered row ---- */
.stepper {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.step-pill {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  line-height: 1.25;
}

.step-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 900;
}

.step-pill.is-active .step-num {
  color: var(--blue-strong);
  border-color: transparent;
}

/* ---- Guest brand header ---- */
.guest-brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px;
}

.guest-brandbar-text {
  display: grid;
  gap: 1px;
}

.guest-brandbar-text .brand-mark {
  color: var(--blue-strong);
  font-size: 0.75rem;
}

.guest-brandbar-text strong {
  color: var(--navy);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.guest-brandbar-sub {
  color: var(--muted);
  font-size: 0.86rem;
}

.guest-staff-link {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  padding: 6px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: right;
  text-decoration: none;
}

.guest-staff-link strong {
  color: var(--blue-strong);
  font-size: 0.9rem;
}

/* ---- Success confirmation ---- */
.success-card--confirm {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.success-icon svg {
  width: 76px;
  height: 76px;
}

.success-icon circle {
  fill: var(--green-bg);
  stroke: #1e8a4c;
  stroke-width: 2.5;
}

.success-icon path {
  fill: none;
  stroke: #1e8a4c;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-card--confirm h1 {
  margin: 0;
  color: var(--green);
}

.success-label {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.success-wo-no {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.8rem, 8.5vw, 2.5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.success-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  color: var(--muted);
}

.success-card--confirm .hero-actions {
  width: 100%;
}

/* ---- KPI / period toolbar: numbers first ---- */
.management-toolbar-card--compact {
  padding: 12px 14px;
}

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

.period-form .management-date-grid .btn {
  grid-column: 1 / -1;
}

.management-period-label {
  margin: 0;
}

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

.kpi-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.kpi-tile h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.kpi-tile .management-kpi-value,
.kpi-tile .management-metric-value {
  margin-top: 2px;
  font-size: 1.55rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.kpi-tile p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.kpi-tile-link {
  margin-top: auto;
  color: var(--blue-strong);
  font-size: 0.88rem;
  font-weight: 800;
}

a.kpi-tile:hover,
a.kpi-tile:focus-visible {
  border-color: rgba(24, 119, 255, 0.5);
}

/* ---- Technician performance: compact hierarchy, no ranking ---- */
.performance-card {
  gap: 10px;
  padding: 16px;
}

.perf-count-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

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

.perf-count-grid div {
  min-width: 0;
  padding: 8px 10px;
  background: var(--surface-soft);
  border: 1px solid #dde6f1;
  border-radius: var(--radius-sm);
}

.perf-count-grid dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.perf-count-grid dd {
  margin: 2px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.perf-subhead {
  margin: 2px 0 -2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.perf-time-list {
  display: grid;
  margin: 0;
}

.perf-time-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #e3eaf4;
}

.perf-time-list dt {
  color: var(--muted);
}

.perf-time-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

/* ---- Touch targets and notifications ---- */
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.notification-card {
  gap: 8px;
  padding: 14px 16px;
}

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

.notification-card-actions .btn {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.95rem;
}

/* ---- Splash loading indicator ---- */
.splash-progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.splash-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #3ca2ff 0%, #ffffff 100%);
  transform-origin: left center;
  animation: splash-load 1.8s ease-out forwards;
}

@keyframes splash-load {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (min-width: 720px) {
  .staff-count-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .kpi-tile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Bottom navigation becomes a centred dock instead of a stretched phone bar. */
  .staff-bottom-nav {
    left: 50%;
    right: auto;
    bottom: 16px;
    width: min(760px, calc(100% - 48px));
    transform: translateX(-50%);
    border-radius: 22px;
  }
}

/* Phones show short step names; the full name stays available to screen readers. */
.step-short {
  display: none;
}

@media (max-width: 719px) {
  .step-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .step-short {
    display: block;
  }
}

@media (max-width: 380px) {
  .step-short {
    font-size: 0.76rem;
  }

  .guest-brandbar-sub {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-progress span {
    animation: none;
  }
}

/* ==========================================================================
   M2-009 monthly report, print view and signatories
   ========================================================================== */

.report-entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  border-left: 5px solid var(--blue);
}

.report-entry-card strong {
  display: block;
  color: var(--navy);
}

.report-entry-card .muted {
  font-size: 0.88rem;
}

.report-entry-arrow {
  color: var(--blue-strong);
  font-size: 1.6rem;
  font-weight: 800;
}

.report-month-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.report-month-form .btn {
  grid-column: 1 / -1;
}

.report-toolbar-links {
  margin: 4px 0 0;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-actions .btn {
  flex: 1 1 200px;
}

.report-notes-form {
  margin-top: 4px;
}

.report-history-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-history-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

/* ---- Report document (screen) ---- */
.report-doc {
  display: grid;
  gap: 18px;
  overflow-wrap: anywhere;
}

.report-doc-header {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--navy);
}

.report-doc-brand {
  color: var(--blue-strong);
  font-size: 0.78rem;
}

.report-doc-product {
  display: block;
  color: var(--navy);
  letter-spacing: 0.08em;
}

.report-doc-title {
  margin: 4px 0 0;
  font-size: 1.35rem;
  line-height: 1.3;
}

.report-doc-month {
  margin: 2px 0 0;
  color: var(--blue-strong);
  font-size: 1.05rem;
  font-weight: 800;
}

.report-doc-meta {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 0.9rem;
}

.report-doc-meta div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.report-doc-meta dt {
  color: var(--muted);
}

.report-doc-meta dd {
  margin: 0;
  font-weight: 700;
}

.report-section {
  display: grid;
  gap: 10px;
}

.report-section h2 {
  margin: 0;
  padding-bottom: 6px;
  color: var(--navy);
  font-size: 1.08rem;
  border-bottom: 1px solid var(--line);
}

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

.report-stat {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid #dde6f1;
  border-radius: var(--radius-sm);
}

.report-stat span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.report-stat strong {
  color: var(--navy);
  font-size: 1.5rem;
}

.report-duration-list {
  display: grid;
  margin: 0;
}

.report-duration-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #e3eaf4;
}

.report-duration-list dt {
  color: var(--muted);
}

.report-duration-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.report-footnote,
.report-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.report-empty {
  padding: 12px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
}

.report-table-wrap {
  min-width: 0;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.report-table th,
.report-table td {
  padding: 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e3eaf4;
  overflow-wrap: anywhere;
}

.report-table thead th {
  color: #fff;
  background: var(--navy);
  font-size: 0.82rem;
}

.report-sub {
  color: var(--muted);
  font-size: 0.85em;
}

.report-wrap {
  white-space: normal;
}

.report-notes {
  margin: 0;
}

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

.signature-block {
  display: grid;
  gap: 2px;
  padding-top: 28px;
  text-align: center;
  break-inside: avoid;
}

.signature-block p {
  margin: 0;
}

.signature-line {
  white-space: nowrap;
  overflow: hidden;
}

.signature-name {
  font-weight: 700;
}

.signature-position,
.signature-role,
.signature-date {
  color: var(--muted);
  font-size: 0.9rem;
}

.report-list-toggle > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  color: var(--blue-strong);
  font-weight: 800;
  background: var(--surface-soft);
  border: 1px solid #dde6f1;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.report-list-toggle[open] > summary {
  margin-bottom: 10px;
}

@media (min-width: 720px) {
  .report-wo-no,
  .report-date {
    white-space: nowrap;
  }
}

/* Tables become labelled cards on phones (no horizontal scrolling). */
@media (max-width: 719px) {
  .report-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

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

  .report-table tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid #dde6f1;
    border-radius: var(--radius-sm);
  }

  .report-table th,
  .report-table td {
    padding: 4px 0;
    border: 0;
  }

  .report-table tbody th {
    color: var(--navy);
    font-size: 1rem;
  }

  .report-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
  }
}

@media (min-width: 720px) {
  .report-month-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }

  .report-month-form .btn {
    grid-column: auto;
  }

  .report-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-doc-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

/* ---- Signatory management ---- */
.signatory-list {
  display: grid;
  gap: 10px;
}

.signatory-card > summary {
  display: grid;
  gap: 2px;
  min-height: 44px;
  cursor: pointer;
}

.signatory-card.is-inactive {
  opacity: 0.7;
}

.signatory-summary-name {
  font-weight: 800;
}

.signatory-summary-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.signatory-card[open] > summary {
  margin-bottom: 10px;
}

.signatory-form-grid {
  display: grid;
  gap: 10px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
}

.checkbox-field input {
  width: 22px;
  height: 22px;
}

@media (min-width: 720px) {
  .signatory-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- Dedicated print page (screen preview) ---- */
body.page-report-print {
  background: #e9eef5;
}

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--navy);
}

.print-toolbar-note {
  color: #ffd98a;
  font-size: 0.9rem;
  font-weight: 700;
}

.report-print-sheet {
  display: grid;
  gap: 16px;
  width: min(210mm, 100% - 24px);
  margin: 16px auto 40px;
  padding: 14mm 12mm;
  background: #fff;
  box-shadow: 0 12px 36px rgba(10, 27, 55, 0.18);
  color: #111827;
  overflow-wrap: anywhere;
}

.report-print-sheet.is-draft {
  background-image: repeating-linear-gradient(-35deg, rgba(10, 27, 55, 0.035) 0 2px, transparent 2px 80px);
}

.report-print-footer {
  padding-top: 8px;
  color: #4b5563;
  font-size: 0.78rem;
  text-align: center;
  border-top: 1px solid #d1d5db;
}

@media (max-width: 719px) {
  .report-print-sheet {
    padding: 16px 12px;
  }
}

/* ---- A4 print ---- */
@page {
  size: A4 portrait;
  margin: 12mm 12mm 14mm;
}

@media print {
  html,
  body,
  body.page-report-print {
    background: #fff !important;
  }

  .print-toolbar,
  .flash-stack,
  .staff-bottom-nav,
  .staff-topbar,
  .staff-sticky-actions,
  .action-sheet,
  .report-actions,
  .report-notes-form,
  .management-toolbar-card {
    display: none !important;
  }

  .report-print-sheet {
    width: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    font-size: 10pt;
    background-image: none;
  }

  .report-print-sheet .report-doc-title {
    font-size: 15pt;
  }

  .report-print-sheet .report-section h2 {
    font-size: 11.5pt;
    break-after: avoid;
  }

  .report-print-sheet,
  .report-print-sheet .report-section {
    gap: 8px;
  }

  .report-print-sheet .report-duration-list div {
    padding: 3px 0;
  }

  .report-print-sheet .report-stat {
    padding: 6px 8px;
  }

  .report-print-sheet .signature-block {
    padding-top: 18px;
  }

  .report-print-sheet .report-wo-no {
    white-space: nowrap;
  }

  .report-print-sheet .report-date {
    white-space: normal;
  }

  /* Fixed A4 column plan; the phone rule (max-width: 719px) can match the A4 printable width. */
  .report-print-sheet .report-table tbody th {
    font-size: 8.5pt;
  }

  .report-print-sheet .report-table--wo {
    table-layout: fixed;
  }

  .report-print-sheet .report-table--wo th:nth-child(1) { width: 15%; }
  .report-print-sheet .report-table--wo th:nth-child(2) { width: 11%; }
  .report-print-sheet .report-table--wo th:nth-child(3) { width: 14%; }
  .report-print-sheet .report-table--wo th:nth-child(4) { width: 29%; }
  .report-print-sheet .report-table--wo th:nth-child(5) { width: 11%; }
  .report-print-sheet .report-table--wo th:nth-child(6) { width: 10%; }
  .report-print-sheet .report-table--wo th:nth-child(7) { width: 10%; }

  .report-print-sheet .report-table--wo .report-sub {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .report-print-sheet .report-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-print-sheet .report-stat strong {
    font-size: 14pt;
  }

  /* Force real tables on paper even if a narrow print width triggers the phone layout. */
  .report-print-sheet .report-table {
    display: table;
    font-size: 8.5pt;
  }

  .report-print-sheet .report-table thead {
    display: table-header-group;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .report-print-sheet .report-table tbody {
    display: table-row-group;
  }

  .report-print-sheet .report-table tr {
    display: table-row;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    break-inside: avoid;
  }

  .report-print-sheet .report-table th,
  .report-print-sheet .report-table td {
    display: table-cell;
    width: auto;
    padding: 4px 5px;
    border-bottom: 1px solid #d1d5db;
  }

  .report-print-sheet .report-table td[data-label]::before {
    content: none;
  }

  .report-print-sheet .report-table thead th {
    color: #111827;
    background: #e5e7eb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-print-sheet .status-badge {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none !important;
    color: #111827 !important;
    font-size: 8.5pt;
  }

  .report-print-sheet .status-badge::before {
    display: none;
  }

  .report-print-sheet .status-badge {
    display: inline;
    white-space: normal;
  }

  .report-signatures {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-print-sheet .signature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-stat,
  .report-duration-list div {
    break-inside: avoid;
  }
}

/* Same A4 column plan for the on-screen print preview sheet. */
@media (min-width: 720px) {
  .report-print-sheet .report-table--wo {
    table-layout: fixed;
  }

  .report-print-sheet .report-table--wo th:nth-child(1) { width: 15%; }
  .report-print-sheet .report-table--wo th:nth-child(2) { width: 11%; }
  .report-print-sheet .report-table--wo th:nth-child(3) { width: 14%; }
  .report-print-sheet .report-table--wo th:nth-child(4) { width: 29%; }
  .report-print-sheet .report-table--wo th:nth-child(5) { width: 11%; }
  .report-print-sheet .report-table--wo th:nth-child(6) { width: 10%; }
  .report-print-sheet .report-table--wo th:nth-child(7) { width: 10%; }

  .report-print-sheet .report-date {
    white-space: normal;
  }

  .report-print-sheet .report-table--wo .status-badge {
    white-space: normal;
  }
}
