:root {
  --navy: #17365d;
  --navy-2: #102744;
  --navy-3: #0b1a2d;
  --blue: #2f6fe4;
  --blue-soft: #dbe8ff;
  --green: #17b26a;
  --green-2: #0f9f6e;
  --green-soft: #daf8e8;
  --gold: #d97706;
  --bg: #eef3f8;
  --bg-soft: #f7fafc;
  --card: rgba(255, 255, 255, 0.94);
  --card-strong: #ffffff;
  --card-soft: #f8fbff;
  --line: #d7e0ea;
  --line-strong: #c6d3e3;
  --text: #122033;
  --text-soft: #23364d;
  --muted: #63758d;
  --success: #0f9f6e;
  --danger: #b93815;
  --warning: #9a6700;
  --shadow-soft: 0 18px 42px rgba(12, 28, 52, 0.08);
  --shadow-card: 0 24px 60px rgba(12, 28, 52, 0.1);
  --shadow-lift: 0 16px 30px rgba(15, 39, 70, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 111, 228, 0.1), transparent 24%),
    radial-gradient(circle at right 20%, rgba(23, 54, 93, 0.08), transparent 28%),
    linear-gradient(180deg, #edf2f7 0%, #f7fafc 45%, #eef3f8 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.18), transparent 40%);
  opacity: 0.9;
}

a {
  color: var(--navy);
  text-decoration: none;
}

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

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

label {
  display: grid;
  gap: 8px;
  color: #3d628f;
  font-weight: 520;
  letter-spacing: -0.01em;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px;
  padding: 13px 14px;
  min-height: 50px;
  font-weight: 400;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: #97a6b8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #9dbcf5;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(47, 111, 228, 0.12);
}

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

button,
.primary-btn,
.ghost-btn,
.danger-btn {
  border: 0;
  border-radius: 16px;
  padding: 12px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 540;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

button:hover,
.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

button:disabled,
.primary-btn:disabled,
.ghost-btn:disabled,
.danger-btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%);
  border: 1px solid rgba(15, 159, 110, 0.2);
  box-shadow: 0 14px 30px rgba(15, 159, 110, 0.22);
}

.ghost-btn {
  color: #fff;
  background: linear-gradient(135deg, #4d87f7 0%, #2f6fe4 54%, #225dc4 100%);
  border: 1px solid rgba(34, 93, 196, 0.24);
  box-shadow: 0 14px 28px rgba(47, 111, 228, 0.22);
}

.danger-btn {
  color: #fff;
  background: linear-gradient(135deg, #b93815 0%, #cf4b25 100%);
  border: 1px solid rgba(185, 56, 21, 0.22);
  box-shadow: 0 12px 24px rgba(185, 56, 21, 0.18);
}

.primary-btn:hover {
  box-shadow: 0 18px 34px rgba(15, 159, 110, 0.24);
}

.ghost-btn:hover {
  box-shadow: 0 18px 34px rgba(47, 111, 228, 0.28);
  filter: saturate(1.04);
}

.danger-btn:hover {
  box-shadow: 0 18px 34px rgba(185, 56, 21, 0.22);
}

.primary-btn:active,
.ghost-btn:active,
.danger-btn:active,
button:active {
  transform: translateY(1px) scale(0.992);
}

.full { width: 100%; }

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
}

.sidebar {
  position: sticky;
  top: 0;
  width: 344px;
  height: 100vh;
  overflow-y: auto;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, var(--navy-2) 0%, var(--navy-3) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 20px 0 44px rgba(12, 28, 52, 0.14);
}

.brand-card {
  padding: 22px 18px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-card img {
  width: 100%;
  max-width: 100%;
  max-height: 136px;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  margin: 0 auto 12px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.brand-role {
  font-size: 1.18rem;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.brand-copy {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
  font-size: 0.94rem;
}

.brand-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.brand-context span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  font-weight: 540;
}

.sidebar-section-title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.74rem;
  font-weight: 540;
  padding: 0 4px;
}

.sidebar-section-title--blue { color: #a9c9ff; }
.sidebar-section-title--green { color: #b4ead0; }
.sidebar-section-title--amber { color: #ffd89a; }

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

.nav-link {
  position: relative;
  display: grid;
  gap: 3px;
  color: rgba(255, 255, 255, 0.92);
  padding: 14px 16px 14px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  letter-spacing: -0.01em;
  transition: background 0.16s ease, transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.nav-link strong {
  font-size: 0.98rem;
  font-weight: 520;
}

.nav-link small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  line-height: 1.35;
}

.nav-link--blue.active::before { background: #9fc7ff; }
.nav-link--green.active::before { background: #73d7a0; }
.nav-link--amber.active::before { background: #f6c46b; }

.nav-link::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 4px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: transparent;
}

.light-stack .nav-link { background: rgba(255, 255, 255, 0.05); }

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(8, 20, 38, 0.14);
}

.nav-link.active::before {
  background: #ffffff;
}

.sidebar-subnav .nav-link--subtle {
  padding: 11px 14px 11px 18px;
  border-radius: 16px;
  font-size: 0.92rem;
  font-weight: 540;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-subnav .nav-link--subtle.active {
  box-shadow: 0 10px 18px rgba(8, 20, 38, 0.18);
}

.sidebar-subnav .nav-link--green.active {
  background: linear-gradient(180deg, rgba(23, 178, 106, 0.24), rgba(15, 159, 110, 0.2));
  border-color: rgba(125, 220, 166, 0.45);
}

.sidebar-subnav .nav-link--blue.active {
  background: linear-gradient(180deg, rgba(47, 111, 228, 0.26), rgba(35, 88, 187, 0.2));
  border-color: rgba(163, 198, 255, 0.44);
}

.sidebar-subnav .nav-link--amber.active {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.26), rgba(180, 101, 6, 0.2));
  border-color: rgba(255, 214, 148, 0.44);
}

.sidebar-subnav .nav-link--subtle small {
  display: none;
}

.sidebar-subnav {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.sidebar-subnav .nav-link--subtle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.inline-foot { margin-top: 16px; }

.user-chip {
  display: grid;
  gap: 4px;
  padding: 14px 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.compact-chip span { font-size: 0.78rem; }

.user-chip span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
}

.main-panel {
  flex: 1;
  min-width: 0;
  padding: 28px 28px 34px;
}

.main-panel.no-sidebar {
  display: grid;
  place-items: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: 26px;
  border: 1px solid rgba(215, 224, 234, 0.95);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(12, 28, 52, 0.08);
}

.topbar-copy {
  display: grid;
  gap: 4px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.85rem, 2vw, 2.2rem);
  letter-spacing: -0.03em;
  font-weight: 560;
}

.topbar-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

body:not(.report-body) .brand-copy,
body:not(.report-body) .brand-context,
body:not(.report-body) .topbar-note,
body:not(.report-body) p.muted,
body:not(.report-body) small.muted {
  display: none !important;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-home { white-space: nowrap; }
.topbar-logout { white-space: nowrap; }

.topbar-info {
  min-width: 224px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid #dbe5f0;
  background: linear-gradient(180deg, #ffffff, #f6faff);
  display: grid;
  gap: 3px;
}

.topbar-info strong { font-size: 0.95rem; }
.topbar-info span { color: var(--muted); font-size: 0.84rem; }

.flow-dock {
  position: sticky;
  top: 104px;
  z-index: 18;
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 24px;
  border: 1px solid rgba(215, 224, 234, 0.95);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 38px rgba(12, 28, 52, 0.08);
}

.flow-dock-main,
.flow-dock-sections {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.flow-dock-main::-webkit-scrollbar,
.flow-dock-sections::-webkit-scrollbar {
  display: none;
}

.flow-cluster {
  display: grid;
  gap: 8px;
  min-width: max-content;
  padding: 10px 12px;
  border-radius: 20px;
  border: 1px solid #dce7f3;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
}

.flow-cluster--blue {
  border-color: #d6e5fb;
  background: linear-gradient(180deg, #ffffff, #f3f8ff);
}

.flow-cluster--green {
  border-color: #cfe8d9;
  background: linear-gradient(180deg, #ffffff, #f2fbf6);
}

.flow-cluster--amber {
  border-color: #f0dfbc;
  background: linear-gradient(180deg, #ffffff, #fff9ee);
}

.flow-cluster-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 580;
  color: var(--muted);
}

.flow-cluster-links {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.flow-chip,
.flow-section-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid #d8e6ff;
  background: #eef5ff;
  color: var(--navy);
  font-weight: 540;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.flow-chip:hover,
.flow-section-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 39, 70, 0.08);
}

.flow-chip--blue,
.flow-section-chip--blue {
  border-color: #d7e6ff;
  background: #eef5ff;
  color: #163b69;
}

.flow-chip--green,
.flow-section-chip--green {
  border-color: #cde9d8;
  background: #eefaf3;
  color: #16603e;
}

.flow-chip--amber,
.flow-section-chip--amber {
  border-color: #efdfb7;
  background: #fff7e8;
  color: #8b5a00;
}

.flow-chip.is-active,
.flow-section-chip.is-active {
  box-shadow: 0 12px 22px rgba(15, 39, 70, 0.12);
}

.flow-chip--blue.is-active,
.flow-section-chip--blue.is-active {
  border-color: #9ec1f4;
  background: linear-gradient(180deg, #ffffff, #e8f1ff);
}

.flow-chip--green.is-active,
.flow-section-chip--green.is-active {
  border-color: #8fd1ae;
  background: linear-gradient(180deg, #ffffff, #eafaf0);
}

.flow-chip--amber.is-active,
.flow-section-chip--amber.is-active {
  border-color: #e7c47f;
  background: linear-gradient(180deg, #ffffff, #fff3da);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 540;
}

.eyebrow.on-dark { color: rgba(255, 255, 255, 0.68); }

.status-badge {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid #ccebd8;
  background: linear-gradient(180deg, #ebfaf2, #dff7ec);
  color: var(--success);
  font-weight: 580;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 540;
  border: 1px solid transparent;
}

.flash.success {
  background: #e7f7f0;
  color: var(--success);
  border-color: #ccebd8;
}

.flash.error {
  background: #fff1f2;
  color: var(--danger);
  border-color: #fecdd3;
}

.grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.grid-main.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-layout { grid-template-columns: 300px 1fr; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 251, 255, 0.96));
  border: 1px solid rgba(215, 224, 234, 0.96);
  border-radius: 30px;
  padding: 24px;
  min-width: 0;
  box-shadow: var(--shadow-soft);
}

.dark-panel {
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: #fff;
}

.hero-card,
.wide-card { grid-column: 1 / -1; }

.hero-card {
  background:
    radial-gradient(circle at top right, rgba(47, 111, 228, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
}

.module-hero {
  padding-top: 20px;
  padding-bottom: 20px;
}

.module-hero--compact .card-head {
  gap: 16px;
  align-items: flex-start;
}

.module-hero--compact h2 {
  font-size: 1.85rem;
}

.module-hero--compact .metric-grid,
.module-hero--compact .quick-strip {
  margin-top: 18px;
}

.narrow-card { max-width: 620px; }

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

.compact-head { margin-bottom: 12px; }
.card-head.split { align-items: center; }

.card-head h2,
.card-head h3 {
  margin: 6px 0 0;
  letter-spacing: -0.03em;
  font-weight: 560;
  line-height: 1.12;
  overflow-wrap: anywhere;
  display: block;
  width: auto;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.card-head h2 { font-size: 1.55rem; }
.card-head h3 { font-size: 1.12rem; }

.card-head p {
  margin: 8px 0 0;
  max-width: 74ch;
  line-height: 1.55;
}

.card-separator {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

body[data-density="compact"] .main-panel,
body[data-density="compact"] .page-main,
body[data-density="compact"] .page-rail,
body[data-density="compact"] .stack-form {
  gap: 14px;
}

body[data-density="compact"] .card,
body[data-density="compact"] .subsection,
body[data-density="compact"] .step-block,
body[data-density="compact"] .metric-card,
body[data-density="compact"] .quick-card,
body[data-density="compact"] .capture-live-card,
body[data-density="compact"] .capture-estimate-card,
body[data-density="compact"] .official-tech-card,
body[data-density="compact"] .labor-row-card,
body[data-density="compact"] .active-ot-card {
  padding: 18px;
}

body[data-density="compact"] .card {
  border-radius: 24px;
}

body[data-density="compact"] input,
body[data-density="compact"] select,
body[data-density="compact"] textarea {
  min-height: 44px;
  padding: 10px 12px;
}

body[data-density="compact"] th,
body[data-density="compact"] td {
  padding: 10px 12px;
}

body[data-density="compact"] .metric-card,
body[data-density="compact"] .quick-card,
body[data-density="compact"] .capture-live-card,
body[data-density="compact"] .capture-estimate-card {
  min-height: 0;
}

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

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

.metric-card {
  min-height: 104px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid #dbe5f0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 253, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 540;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.34rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 560;
}

.metric-card.small strong {
  font-size: 1.08rem;
}

.metric-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

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

.quick-card {
  min-height: 120px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid #dbe5f0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.quick-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.22rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.quick-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.48;
  font-size: 0.92rem;
}

.photo-uploader-card {
  min-width: 0;
}

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

.file-upload-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  border: 1px dashed #c9d8e8;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 253, 0.98));
}

.file-upload-card input[type="file"] {
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid #d8e4ef;
  background: #ffffff;
}

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.photo-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid #dbe5f0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.photo-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #d6e3ef;
  background: #eff5fb;
}

.photo-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.18s ease;
}

.photo-card__thumb:hover img {
  transform: scale(1.02);
}

.photo-card__meta {
  display: grid;
  gap: 4px;
}

.photo-card__meta strong {
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.photo-card__meta span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.empty-photo-state {
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed #d5e1ec;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.98));
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.capture-ot-switcher {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 24px;
  border: 1px solid #d8e4ef;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.98));
}

.capture-ot-switcher-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.capture-ot-switcher-head strong {
  display: block;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.capture-ot-switcher-track {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.capture-ot-switcher-track::-webkit-scrollbar {
  display: none;
}

.capture-ot-pill {
  min-width: 210px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid #d8e6f2;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: var(--text);
  text-align: left;
  box-shadow: 0 10px 20px rgba(15, 39, 70, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.capture-ot-pill strong,
.capture-ot-pill span,
.capture-ot-pill small {
  display: block;
}

.capture-ot-pill span,
.capture-ot-pill small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.capture-ot-pill.is-active {
  border-color: #8fd1ae;
  background: linear-gradient(180deg, #ffffff, #eefbf4);
  box-shadow: 0 14px 26px rgba(23, 178, 106, 0.18);
}

.capture-ot-pill--ready {
  border-color: #cfe0ff;
  background: linear-gradient(180deg, #ffffff, #f3f8ff);
}

.stack-form { display: grid; gap: 14px; }
.form-flow { gap: 18px; }

.grid-1,
.grid-2,
.grid-3,
.grid-4,
.split-grid {
  display: grid;
  gap: 14px;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2,
.split-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-forms { grid-template-columns: 1fr 1fr; }
.mini-gap { gap: 10px; }
.grid-span-3 { grid-column: span 3; }

.management-grid {
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  align-items: start;
}

.management-form,
.management-list {
  border-radius: 28px;
  border: 1px solid #dbe5f1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  box-shadow: 0 16px 34px rgba(18, 34, 51, 0.06);
}

.management-form {
  padding: 22px;
}

.management-list {
  padding: 6px;
}

.subsection {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f9fbfe, #f5f8fc);
}

.subsection h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: -0.02em;
  font-weight: 560;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.table-wrap td input:not([type="checkbox"]),
.table-wrap td select,
.table-wrap td textarea {
  min-height: 42px;
  border-radius: 14px;
  background: #ffffff;
  border-color: #d4dfeb;
}

.table-wrap td input[type="checkbox"] {
  inline-size: 18px;
  block-size: 18px;
}

.step-block {
  padding: 20px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 253, 0.98));
  border: 1px solid #dce6f1;
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.step-index {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, #2c5e90 100%);
  box-shadow: 0 10px 18px rgba(23, 54, 93, 0.16);
  font-weight: 600;
}

.step-copy {
  display: grid;
  gap: 4px;
}

.step-copy h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
}

.step-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 500;
}

.workflow-board {
  background:
    radial-gradient(circle at right top, rgba(47, 111, 228, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
}

.workflow-nav {
  display: grid;
  gap: 10px;
}

.workflow-link {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #d8e4f0;
  background: linear-gradient(180deg, #fbfdff, #f4f9ff);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.workflow-link strong {
  color: var(--navy);
  letter-spacing: -0.01em;
}

.workflow-link span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.workflow-link:hover {
  transform: translateY(-1px);
  border-color: #bfd2eb;
  box-shadow: 0 12px 24px rgba(15, 39, 70, 0.08);
}

.workflow-link.is-active {
  border-color: #8fd1ae;
  background: linear-gradient(180deg, #ffffff, #eefbf4);
  box-shadow: 0 14px 26px rgba(23, 178, 106, 0.18);
}

.review-action-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid #dbe5f2;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
  box-shadow: 0 14px 28px rgba(15, 39, 70, 0.08);
}

.review-action-card h3 {
  margin: 4px 0 0;
  font-size: 1.08rem;
  font-weight: 600;
}

.review-action-card p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.review-action-card--approve {
  border-color: #cfe8d9;
  background: linear-gradient(180deg, #ffffff, #f1fbf5);
}

.review-action-card--return {
  border-color: #f6d0d7;
  background: linear-gradient(180deg, #ffffff, #fff6f7);
}

.review-action-card--neutral {
  border-color: #d8e4f0;
  background: linear-gradient(180deg, #ffffff, #f6f9fd);
}

.table-head-stack {
  display: grid;
  gap: 4px;
}

.table-head-stack strong {
  color: var(--navy);
  font-weight: 600;
}

.table-head-stack small {
  color: var(--muted);
  font-size: 0.78rem;
}

.energy-grid-wrap table {
  min-width: 1640px;
}

.energy-grid-cell {
  min-width: 134px;
}

.energy-grid-input {
  min-width: 108px;
  min-height: 42px;
  padding: 10px 12px;
}

.energy-grid-cell .pill {
  margin-top: 8px;
}

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

.center-row { justify-content: center; }
.top-gap { margin-top: 16px; }

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.status-pills.stacked { flex-direction: column; }

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid #d8e6ff;
  background: #eef5ff;
  color: var(--navy);
  font-weight: 600;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.check-chip {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.check-chip input {
  width: auto;
  min-height: auto;
  margin: 0 6px 0 0;
  box-shadow: none;
}

.check-chip span { font-weight: 560; }
.check-chip small { color: var(--muted); }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

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

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid #eaf0f6;
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, var(--navy), #21466f);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody td {
  line-height: 1.45;
}

tbody td:first-child {
  font-weight: 600;
}

tbody tr:nth-child(even) td {
  background: rgba(248, 251, 255, 0.55);
}

tbody tr:hover td {
  background: rgba(232, 240, 252, 0.5);
}

.empty {
  text-align: center;
  color: var(--muted);
}

.info-list {
  display: grid;
  gap: 10px;
  color: var(--text);
}

.short-table {
  max-height: 420px;
  overflow: auto;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.page-shell.page-shell--records {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

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

.page-shell.page-shell--single .page-main {
  grid-column: 1 / -1;
}

.page-main,
.page-rail {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.anchor-section {
  scroll-margin-top: 114px;
}

.page-rail {
  position: sticky;
  top: 108px;
  align-self: start;
}

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

.admin-tabs-card {
  padding-top: 20px;
  padding-bottom: 20px;
  background:
    radial-gradient(circle at top right, rgba(109, 163, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96));
}

.soft-section {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(215, 224, 234, 0.92);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.product-process-row {
  display: grid;
  gap: 8px;
}

.field-title {
  display: inline-block;
  color: #214b85;
  font-weight: 560;
  white-space: normal;
  max-width: 100%;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.product-form-advanced label,
.management-form label,
.subsection label {
  min-width: 0;
}

.product-form-advanced .grid-2,
.product-form-advanced .grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.product-form-advanced .builder-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.product-form-advanced .builder-remove-btn {
  min-height: 46px;
}

.builder-remove-btn {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: rgba(154, 103, 0, 0.2);
  box-shadow: 0 12px 24px rgba(217, 119, 6, 0.2);
}

.builder-remove-btn:hover {
  box-shadow: 0 18px 34px rgba(217, 119, 6, 0.24);
}

.product-form-advanced .soft-section,
.management-form,
.management-list {
  min-width: 0;
}

.builder-list {
  gap: 12px;
}

.builder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.builder-remove-btn {
  min-height: 50px;
  align-self: stretch;
}

.consumable-builder-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid #dbe4f0;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.consumable-builder-row__note {
  grid-column: 1 / span 3;
}

.admin-tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 18px;
  border: 1px solid #d7e4f2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.96));
  color: #224870;
  font-size: 1rem;
  font-weight: 560;
  letter-spacing: -0.015em;
  box-shadow:
    0 10px 18px rgba(15, 39, 70, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
  position: relative;
  overflow: hidden;
}

.admin-tab::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(180deg, rgba(50, 123, 232, 0.15), rgba(50, 123, 232, 0.08));
  transition: width 0.18s ease;
}

.admin-tab:hover {
  transform: translateY(-2px);
  border-color: #b6cdea;
  box-shadow:
    0 16px 26px rgba(15, 39, 70, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(236, 244, 255, 0.98));
}

.admin-tab:hover::before,
.admin-tab:focus-visible::before,
.admin-tab.is-active::before,
.admin-tab[aria-current="true"]::before {
  width: 100%;
}

.admin-tab:focus-visible {
  outline: none;
  border-color: #8fb4e6;
  box-shadow:
    0 0 0 4px rgba(47, 111, 228, 0.12),
    0 16px 28px rgba(15, 39, 70, 0.08);
}

.admin-tab:active {
  transform: translateY(1px) scale(0.992);
  box-shadow:
    0 6px 12px rgba(15, 39, 70, 0.08),
    inset 0 2px 4px rgba(15, 39, 70, 0.08);
}

.admin-tab.is-active,
.admin-tab[aria-current="true"] {
  color: #163d6c;
  border-color: #98bae6;
  background:
    linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(224, 236, 252, 0.98));
  box-shadow:
    0 18px 30px rgba(21, 48, 84, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.admin-action-btn {
  min-height: 52px;
  padding-inline: 20px;
  font-weight: 600;
  box-shadow:
    0 12px 22px rgba(15, 39, 70, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.admin-action-btn:hover {
  box-shadow:
    0 18px 28px rgba(15, 39, 70, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.section-link {
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid #d7e5f3;
  background: linear-gradient(180deg, #fbfdff, #f4f9ff);
  color: var(--navy);
  font-weight: 560;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.section-link small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 520;
  line-height: 1.35;
}

.section-link:hover {
  transform: translateY(-1px);
  border-color: #bfd7ee;
  box-shadow: 0 12px 22px rgba(15, 39, 70, 0.08);
  background: linear-gradient(180deg, #ffffff, #eef6ff);
}

.section-link.is-active {
  border-color: #8fd1ae;
  background: linear-gradient(180deg, #ffffff, #eefbf4);
  box-shadow: 0 14px 26px rgba(23, 178, 106, 0.12);
}

.module-card.is-module-hidden,
.form-card.is-module-hidden,
.step-block.is-module-hidden,
.page-rail.is-module-hidden {
  display: none;
}

.sticky-nav {
  position: sticky;
  top: 108px;
  align-self: start;
}

.rail-list {
  display: grid;
  gap: 10px;
}

.rail-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #dce6f1;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.rail-item strong {
  display: block;
  margin-bottom: 4px;
}

.lot-summary-grid {
  display: grid;
  gap: 10px;
}

.mini-metric {
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid #dde7f3;
  background: linear-gradient(180deg, #ffffff, #f6faff);
}

.mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 1rem;
  line-height: 1.35;
}

.helper-list {
  display: grid;
  gap: 12px;
}

.helper-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #dde6f0;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.helper-item span {
  color: var(--muted);
  line-height: 1.5;
}

.official-tech-list,
.labor-grid,
.active-ot-list {
  display: grid;
  gap: 12px;
}

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

.official-tech-card,
.labor-row-card,
.active-ot-card {
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid #dbe5f0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
}

.official-tech-card strong,
.labor-row-head strong,
.active-ot-top strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.official-tech-card span,
.labor-row-head span,
.active-ot-top span,
.active-ot-meta span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.labor-row-card {
  display: grid;
  gap: 12px;
}

.labor-row-card--inactive {
  opacity: 0.6;
  border-style: dashed;
}

.toggle-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(229, 239, 248, 0.8);
  color: var(--navy);
  font-size: 0.9rem;
}

.toggle-check input {
  margin: 0;
}

.labor-row-fields {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 12px;
}

.active-ot-top,
.active-ot-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.active-ot-meta {
  flex-wrap: wrap;
  padding-top: 6px;
}

.active-ot-card--ready {
  border-color: #cae5d3;
  background: linear-gradient(180deg, rgba(242, 252, 246, 0.98), rgba(248, 252, 249, 0.96));
}

.anchor-section { scroll-margin-top: 120px; }

.anchor-section.is-active {
  border-color: #bfd7ee;
  box-shadow: 0 18px 34px rgba(15, 39, 70, 0.08);
}

.report-body {
  background: #edf3f9;
}

.report-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 18px;
}

.report-toolbar,
.report-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(215, 224, 234, 0.96);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
}

.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 24px;
}

.report-toolbar h1 {
  margin: 4px 0 8px;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.report-logo {
  display: block;
  width: min(100%, 430px);
  max-height: 152px;
  object-fit: contain;
  object-position: center;
  margin: 0 auto 14px;
}

.report-toolbar p {
  margin: 0;
}

.report-card {
  padding: 22px;
}

.report-table-wrap {
  max-height: none;
}

.login-wrap {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 30px;
}

.login-stage {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 430px);
  gap: 24px;
  align-items: stretch;
}

.login-stage--compact {
  width: min(460px, 100%);
  grid-template-columns: 1fr;
  justify-content: center;
}

.login-showcase {
  padding: 36px;
  border-radius: 34px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 26%),
    linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 45%, #27578a 100%);
  box-shadow: var(--shadow-card);
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.login-showcase h1 {
  margin: 0;
  font-size: clamp(2.2rem, 3.5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.login-showcase p {
  margin: 0;
  max-width: 62ch;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.65;
  font-size: 1rem;
}

.login-points {
  display: grid;
  gap: 12px;
}

.login-point {
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-point strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1rem;
}

.login-point span {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

.login-card {
  width: 100%;
  align-self: center;
  padding: 30px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 253, 255, 0.97));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.login-card h1,
.login-card h2 {
  margin: 6px 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
  font-weight: 560;
}

.login-logo {
  display: block;
  width: min(100%, 430px);
  max-height: 176px;
  object-fit: contain;
  object-position: center;
  margin: 0 auto 18px;
}

.muted { color: var(--muted); }
.on-dark { color: rgba(255, 255, 255, 0.72); }
.small { font-size: 0.9rem; }

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.media-lightbox[hidden] {
  display: none;
}

.media-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.74);
  backdrop-filter: blur(8px);
}

.media-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(92vw, 1100px);
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 18px;
  border-radius: 28px;
  background: rgba(10, 23, 42, 0.94);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.34);
}

.media-lightbox__close {
  justify-self: end;
}

.media-lightbox__dialog img {
  width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  object-position: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.media-lightbox__dialog figcaption {
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  line-height: 1.5;
}

body.is-lightbox-open {
  overflow: hidden;
}

.login-form {
  display: grid;
  gap: 14px;
  margin: 18px 0;
}

.credentials-box {
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed #c7d2e0;
  background: #f8fafc;
  display: grid;
  gap: 6px;
}

.compact-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.compact-form label {
  min-width: 110px;
  flex: 1 1 180px;
}

.compact-form > button,
.compact-form > a,
.compact-form > .ghost-btn,
.compact-form > .primary-btn {
  flex: 0 0 auto;
}

.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.full-form { width: 100%; }

.notice {
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}

.notice.info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #d6e5ff;
}

.notice.success {
  background: #ecfdf5;
  color: #0f9f6e;
  border-color: #ccebd8;
}

.notice.error {
  background: #fff1f2;
  color: #b42318;
  border-color: #fecdd3;
}

.error-card {
  text-align: center;
  padding: 40px;
}

.pill--good {
  background: #e9f9ef;
  border-color: #b9e7c6;
  color: #166534;
}

.pill--warn {
  background: #fff6df;
  border-color: #f5d98c;
  color: var(--warning);
}

.pill--bad {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #b42318;
}

.pill--info {
  background: #eef5ff;
  border-color: #cfe0ff;
  color: #17365d;
}

.pill--neutral {
  background: #f8fafc;
  border-color: #d9e2ec;
  color: #475569;
}

.table-form { display: contents; }

.table-wrap input[type="text"],
.table-wrap input[type="number"],
.table-wrap select {
  min-width: 90px;
}

.table-wrap td .inline-form.compact-form.table-form input[type="text"] {
  min-width: 120px;
}

.table-wrap--sticky-first th:first-child,
.table-wrap--sticky-first td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.table-wrap--sticky-first thead th:first-child {
  z-index: 3;
}

.table-wrap--sticky-first tbody td:first-child {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 10px 0 14px rgba(15, 39, 70, 0.06);
}

.table-wrap--sticky-first tbody tr:nth-child(even) td:first-child {
  background: rgba(248, 251, 255, 0.96);
}

.table-wrap--comfort table {
  min-width: 820px;
}

.table-wrap--dense th,
.table-wrap--dense td {
  padding: 10px 12px;
  font-size: 0.9rem;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

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

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.workflow-step {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid #d7e5f2;
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
  color: var(--navy);
  box-shadow:
    0 12px 24px rgba(15, 39, 70, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.workflow-step:hover {
  transform: translateY(-2px);
  border-color: #bcd8ee;
  background: linear-gradient(180deg, #ffffff, #eef6ff);
  box-shadow:
    0 16px 28px rgba(15, 39, 70, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.workflow-step--static {
  cursor: default;
}

.workflow-step--static:hover {
  transform: none;
  border-color: #d7e5f2;
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
  box-shadow:
    0 12px 24px rgba(15, 39, 70, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.workflow-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1f4f8c, #153962);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
}

.workflow-step strong {
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.workflow-step small {
  color: var(--muted);
  line-height: 1.4;
}

.admin-user-grid .subsection {
  height: 100%;
  align-content: start;
}

.form-footer-bar {
  position: sticky;
  bottom: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid #dbe5f0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 34px rgba(15, 39, 70, 0.12);
}

.form-footer-copy {
  display: grid;
  gap: 4px;
}

.form-footer-copy strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.product-economics-grid .metric-card {
  min-height: 116px;
}

.form-footer-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.form-footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.capture-progress-card {
  display: grid;
  gap: 16px;
  border: 1px solid #cfead9;
  background:
    radial-gradient(circle at top right, rgba(23, 178, 106, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 252, 247, 0.98));
}

.capture-progress-meter {
  display: grid;
  gap: 10px;
}

.capture-progress-track {
  position: relative;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, #eaf4ee, #dcefe3);
  border: 1px solid #cfe5d8;
}

.capture-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #18b56b 0%, #22c97e 48%, #4ed89a 100%);
  box-shadow: 0 0 0 1px rgba(15, 159, 110, 0.14), 0 8px 18px rgba(23, 178, 106, 0.28);
  transition: width 0.22s ease;
}

.capture-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.capture-progress-meta strong {
  color: var(--green-2);
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.capture-progress-meta span {
  color: var(--muted);
  line-height: 1.45;
}

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

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

.capture-live-card {
  min-height: 118px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid #d7e6df;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 252, 248, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.capture-live-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.24rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--green-2);
}

.capture-live-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.capture-draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid #d9e7f2;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 253, 0.98));
}

.capture-draft-copy {
  display: grid;
  gap: 4px;
}

.capture-draft-copy strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.capture-draft-copy span {
  color: var(--muted);
  line-height: 1.45;
}

.capture-command-bar {
  position: sticky;
  top: 94px;
  z-index: 7;
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid #d6e7dd;
  background:
    radial-gradient(circle at top right, rgba(23, 178, 106, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 247, 0.98));
  box-shadow: 0 18px 32px rgba(15, 39, 70, 0.08);
}

.capture-command-main {
  display: grid;
  gap: 6px;
}

.capture-command-main strong {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.capture-command-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.capture-command-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.capture-command-chip {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid #d7e6df;
  background: rgba(255, 255, 255, 0.82);
}

.capture-command-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.capture-command-chip strong {
  display: block;
  margin-top: 6px;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.capture-command-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.capture-command-link {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d7e3ef;
  background: rgba(255, 255, 255, 0.9);
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.capture-command-link.is-active {
  border-color: #8fd1ae;
  background: linear-gradient(180deg, #ffffff, #eefbf4);
  color: #166534;
  box-shadow: 0 10px 18px rgba(23, 178, 106, 0.12);
}

[data-work-start] {
  scroll-margin-top: 126px;
}

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

.capture-estimate-card {
  min-height: 130px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid #d9e7f2;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.capture-estimate-card--total {
  border-color: #bfe8ce;
  background:
    radial-gradient(circle at top right, rgba(23, 178, 106, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 251, 245, 0.98));
}

.capture-estimate-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.38rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: var(--navy);
}

.capture-estimate-card--total strong {
  color: var(--green-2);
}

.capture-estimate-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.capture-progress-step {
  width: 100%;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid #d8e4ef;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.capture-progress-step:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 39, 70, 0.1);
}

.capture-progress-step.is-active {
  border-color: #9fc2ff;
  background: linear-gradient(180deg, #ffffff, #edf5ff);
  box-shadow: 0 16px 30px rgba(47, 111, 228, 0.14);
}

.capture-progress-index {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e7eef7, #dce7f4);
  color: var(--navy);
  font-weight: 650;
}

.capture-progress-step strong {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.02em;
  font-weight: 620;
}

.capture-progress-step small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.capture-progress-state {
  align-self: start;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #d7e0ea;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.capture-progress-step[data-state="ready"] {
  border-color: #bfe8ce;
  background: linear-gradient(180deg, #ffffff, #f2fbf6);
}

.capture-progress-step[data-state="ready"] .capture-progress-index {
  background: linear-gradient(135deg, #18b56b, #28c47a);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(23, 178, 106, 0.18);
}

.capture-progress-step[data-state="ready"] .capture-progress-state {
  background: var(--green-soft);
  border-color: #b9e7c6;
  color: #166534;
}

.capture-progress-step[data-state="progress"] {
  border-color: #cde0fb;
  background: linear-gradient(180deg, #ffffff, #f3f8ff);
}

.capture-progress-step[data-state="progress"] .capture-progress-state {
  background: #eef5ff;
  border-color: #cfe0ff;
  color: #17365d;
}

.capture-progress-step[data-state="attention"] {
  border-color: #f0d89a;
  background: linear-gradient(180deg, #fffef8, #fff8e8);
}

.capture-progress-step[data-state="attention"] .capture-progress-state {
  background: #fff6df;
  border-color: #f5d98c;
  color: #9a6700;
}

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

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

@media (max-width: 1280px) {
  .sidebar {
    width: 300px;
    padding: 20px 14px;
  }

  .main-panel {
    padding: 20px 18px 26px;
  }

  .page-shell {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 340px);
  }

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

  .flow-dock {
    top: 94px;
  }

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

  .product-form-advanced .grid-2,
  .product-form-advanced .grid-4,
  .consumable-builder-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .grid-main,
  .grid-main.two-up,
  .admin-layout,
  .page-shell,
  .page-shell.page-shell--records,
  .login-stage,
  .report-toolbar {
    grid-template-columns: 1fr;
  }

  .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4,
  .split-grid,
  .management-grid,
  .two-forms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-rail,
  .sticky-nav { position: static; }
  .login-card { max-width: 560px; }
  .report-toolbar { display: grid; }
  .report-logo {
    margin: 0 auto 14px;
  }
  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }
  .flow-dock {
    top: 12px;
  }
  .topbar-right {
    justify-content: flex-start;
  }
  .topbar-info {
    min-width: 0;
  }
  .card {
    padding: 20px;
  }
  .module-hero--compact h2 {
    font-size: 1.55rem;
  }

  .sidebar-section-title {
    margin-top: 2px;
  }

  .nav-stack,
  .sidebar-subnav {
    gap: 7px;
  }

  .sidebar-subnav .nav-link--subtle {
    min-height: 48px;
  }
}

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    gap: 12px;
    padding: 14px;
  }
  .brand-card {
    padding: 16px;
  }
  .brand-copy,
  .brand-context {
    display: none;
  }
  .nav-stack,
  .sidebar-subnav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 4px;
  }
  .nav-link,
  .sidebar-subnav .nav-link--subtle {
    display: flex;
    align-items: center;
    white-space: normal;
    min-height: 46px;
    width: 100%;
  }
  .nav-link small {
    display: none;
  }
  .sidebar-foot {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
  }
  .sidebar-foot .user-chip {
    flex: 1 1 220px;
  }
  .sidebar-foot .ghost-btn.full {
    width: auto;
    min-width: 160px;
  }
  .main-panel { padding: 18px; }
  .topbar {
    position: static;
    flex-direction: column;
    gap: 12px;
  }
  .card-head,
  .card-head.split {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-dock {
    position: sticky;
    top: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 20px;
  }
  .flow-dock-main {
    display: grid;
    gap: 10px;
  }
  .flow-cluster {
    min-width: 0;
  }
  .flow-cluster-links,
  .flow-dock-sections {
    overflow: auto;
    flex-wrap: nowrap;
  }
  .grid-2,
  .grid-3,
  .grid-4,
  .cols-2,
  .cols-4,
  .cols-5,
  .management-grid,
  .quick-strip,
  .capture-ot-switcher-head,
  .capture-progress-grid,
  .capture-live-grid,
  .capture-estimate-grid,
  .split-grid,
  .two-forms,
  .checkbox-grid,
  .section-menu-grid,
  .search-grid,
  .dashboard-link-grid,
  .workflow-strip,
  .official-tech-list,
  .admin-user-grid,
  .labor-row-fields,
  .consumable-builder-row {
    grid-template-columns: 1fr;
  }
  .consumable-builder-row__note {
    grid-column: auto;
  }
  .admin-tab-strip {
    display: grid;
    grid-template-columns: 1fr;
  }
  .form-footer-bar {
    position: static;
    display: grid;
    padding: 16px;
  }
  .capture-draft-bar {
    display: grid;
  }
  .capture-command-bar {
    position: static;
  }
  .capture-command-meta {
    grid-template-columns: 1fr;
  }
  .capture-command-nav {
    overflow: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .capture-command-nav::-webkit-scrollbar {
    display: none;
  }
  .form-footer-actions {
    width: 100%;
  }
  .form-footer-actions .primary-btn,
  .form-footer-actions .ghost-btn {
    width: 100%;
  }
  .pagination-row { justify-content: center; }
  .compact-form,
  .inline-form,
  .action-row,
  .capture-progress-meta,
  .active-ot-top,
  .active-ot-meta {
    display: grid;
    grid-template-columns: 1fr;
  }
  .compact-form label,
  .inline-form label {
    min-width: 0;
    flex: 1 1 auto;
  }
  .table-wrap--comfort table,
  .table-wrap--dense table {
    min-width: 640px;
  }
  .metric-card strong,
  .quick-card strong,
  .active-ot-top strong,
  .card-head h2,
  .topbar h1 {
    overflow-wrap: anywhere;
  }
  .login-wrap { padding: 18px; }
  .login-showcase,
  .login-card,
  .card,
  .subsection,
  .step-block {
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    padding: 12px;
  }

  .nav-stack,
  .sidebar-subnav {
    grid-template-columns: 1fr;
  }

  .main-panel {
    padding: 14px;
  }

  .card,
  .subsection,
  .step-block,
  .management-form,
  .management-list {
    padding: 16px;
    border-radius: 20px;
  }

  .energy-grid-wrap table {
    min-width: 1320px;
  }

  .energy-grid-cell {
    min-width: 116px;
  }

  .energy-grid-input {
    min-width: 92px;
    min-height: 40px;
    padding: 8px 10px;
  }

  .table-head-stack strong,
  .table-head-stack small,
  .field-title,
  .card-head h2,
  .topbar h1 {
    overflow-wrap: anywhere;
  }

  .compact-form,
  .inline-form,
  .action-row,
  .topbar-right {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ghost-btn.full,
  .topbar-home,
  .topbar-logout,
  .primary-btn,
  .danger-btn {
    width: 100%;
  }
}

@media print {
  body.report-body {
    background: #ffffff;
  }

  .report-toolbar .action-row {
    display: none;
  }

  .report-shell {
    max-width: none;
    padding: 0;
  }

  .report-toolbar,
  .report-card {
    box-shadow: none;
    border-color: #d3dbe5;
    break-inside: avoid;
  }
}
