* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
  background: #f4f6fb;
  color: #16202f;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(55, 116, 255, 0.14), transparent 24%),
    radial-gradient(circle at bottom right, rgba(21, 168, 94, 0.14), transparent 30%),
    linear-gradient(180deg, #0f1622 0%, #121a28 100%);
  padding: 24px;
}

.auth-card {
  width: min(760px, 100%);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.24);
}

.auth-brand {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-mark {
  min-width: 72px;
  height: 72px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0d2617, #1f8f49);
  color: #f7f7f3;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2e7d48;
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

.lede,
#pageSubtitle {
  color: #617085;
  margin: 8px 0 0;
}

.auth-status-row,
.button-row,
.topbar-actions,
.map-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-grid,
.form-grid {
  display: grid;
  gap: 14px;
}

.auth-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0;
}

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

.field {
  display: block;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #526176;
  font-weight: 600;
}

input,
select,
textarea,
.json-view,
.terminal,
.date-range {
  width: 100%;
  border: 1px solid #d9dfeb;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  font: inherit;
  color: #152132;
}

textarea,
.json-view,
.terminal {
  min-height: 120px;
}

.terminal,
.json-view {
  white-space: pre-wrap;
  overflow: auto;
  font-family: "Fira Code", "Consolas", monospace;
}

.terminal {
  background: #0f1622;
  color: #e3ecfb;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

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

.btn.primary {
  background: #1f7cff;
  color: #fff;
}

.btn.secondary {
  background: #eef3fb;
  color: #19304e;
}

.btn.danger {
  background: #ffe8e8;
  color: #b92727;
}

.btn.sidebar-btn {
  width: 100%;
  background: #0f1a2a;
  color: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.success {
  background: rgba(29, 170, 98, 0.15);
  color: #0c8b47;
}

.pill.warn {
  background: rgba(245, 164, 42, 0.15);
  color: #c57805;
}

.pill.danger {
  background: rgba(230, 61, 61, 0.14);
  color: #b92727;
}

.pill.neutral {
  background: rgba(31, 124, 255, 0.12);
  color: #2566c0;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  position: relative;
  width: 100%;
  overflow-x: hidden;
}

.toast-shell {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #172338;
  color: #eef4ff;
  box-shadow: 0 20px 40px rgba(10, 22, 42, 0.26);
  border-left: 4px solid #1f7cff;
}

.toast strong,
.toast span,
.toast small {
  display: block;
}

.toast strong {
  margin-bottom: 6px;
}

.toast small {
  margin-top: 6px;
  color: #b7c8e4;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(10, 20, 18, 0.95), rgba(9, 16, 25, 0.98)),
    radial-gradient(circle at top, rgba(30, 170, 75, 0.18), transparent 26%);
  color: #eef6ef;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 6px 12px;
}

.sidebar-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(145deg, #0d2518, #1b7a41);
  display: grid;
  place-items: center;
}

.logo-oil {
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sidebar-brand strong {
  display: block;
  font-size: 18px;
}

.sidebar-brand small {
  color: #96b8a1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: transparent;
  color: #d9e7dd;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(47, 148, 78, 0.22);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3ea45e, #19482a);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.user-card small {
  display: block;
  color: #9fc0ab;
}

.main-pane {
  padding: 26px;
  min-width: 0;
  overflow-x: hidden;
}

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

.search-shell {
  min-width: 280px;
}

.search-shell input {
  padding-left: 16px;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
  min-width: 0;
}

.inset-panel {
  background: #f8fbff;
  border: 1px solid #dbe5f3;
}

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

.metric-card,
.panel {
  background: #fff;
  border: 1px solid #e2e8f2;
  border-radius: 22px;
  box-shadow: 0 14px 30px rgba(22, 34, 52, 0.06);
}

.metric-card {
  padding: 16px 18px;
}

.metric-card.metric-link {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.metric-card.metric-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(22, 34, 52, 0.1);
  border-color: #b7c7dd;
}

.metric-card.green { border-top: 4px solid #4cae63; }
.metric-card.blue { border-top: 4px solid #3e7dff; }
.metric-card.purple { border-top: 4px solid #8b5cf6; }
.metric-card.orange { border-top: 4px solid #f28c28; }
.metric-card.emerald { border-top: 4px solid #16a085; }
.metric-card.red { border-top: 4px solid #ef4444; }

.metric-label {
  color: #65748a;
  font-size: 13px;
  font-weight: 700;
}

.metric-value {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 800;
}

.metric-detail {
  margin-top: 6px;
  color: #8391a4;
  font-size: 12px;
}

.dashboard-grid,
.section-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

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

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

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

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

.section-grid.data {
  grid-template-columns: 1.1fr 1.3fr;
  align-items: start;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel.wide {
  grid-column: span 1;
}

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

.panel-head p {
  margin: 6px 0 0;
  color: #7a8899;
}

.panel-chip {
  background: #eff5ff;
  color: #3767c9;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.donut-shell {
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.donut-shell.compact {
  min-height: 220px;
}

.donut {
  width: 188px;
  height: 188px;
  border-radius: 50%;
  background: conic-gradient(#4c8bf5 0deg 72deg, #66bb6a 72deg 144deg, #f4a742 144deg 216deg, #ef5350 216deg 288deg, #8e66ff 288deg 360deg);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: #fff;
}

.donut-center {
  position: absolute;
  font-size: 30px;
  font-weight: 800;
}

.legend-list,
.health-list,
.announcement-list,
.kv-list,
.roles-grid {
  display: grid;
  gap: 10px;
}

.report-grid {
  display: grid;
  gap: 12px;
}

.report-card {
  border: 1px solid #dde6f2;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  padding: 16px;
  box-shadow: 0 8px 20px rgba(22, 34, 52, 0.05);
}

.report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.report-card-head strong {
  font-size: 18px;
}

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

.report-empty {
  border: 1px dashed #cfd9e6;
  border-radius: 18px;
  background: #fbfcfe;
  color: #6c7c90;
  padding: 18px;
}

.legend-item,
.health-item,
.announcement-item,
.kv-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f7f9fc;
}

.health-item.good { color: #198650; }
.health-item.warn { color: #c77b08; }
.health-item.bad { color: #c23030; }

.announcement-item {
  flex-direction: column;
  align-items: flex-start;
}

.table-shell {
  overflow-y: auto;
  overflow-x: hidden;
}

.table-shell.short {
  max-height: 360px;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.activity-table th,
.activity-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.activity-table td .btn {
  white-space: nowrap;
}

.activity-table th {
  color: #68788f;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.activity-table tr.selected-row td {
  background: #eef5ff;
}

.status-dot {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot.success {
  background: rgba(25, 134, 80, 0.14);
  color: #198650;
}

.status-dot.warn {
  background: rgba(245, 164, 42, 0.16);
  color: #b56f05;
}

.status-dot.danger {
  background: rgba(230, 61, 61, 0.14);
  color: #c23030;
}

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

.quick-card {
  border: 1px solid #e4eaf3;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f6f9ff);
  padding: 16px;
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
}

.admin-map {
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #dbe2ef;
}

.map-sidebar {
  display: grid;
  gap: 10px;
}

.map-status {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f8fc;
  color: #44556f;
  font-weight: 600;
}

.leaflet-container {
  width: 100%;
  height: 100%;
}

.json-view.compact {
  min-height: 90px;
}

.activity-footer {
  margin-top: 20px;
}

.workflow-shell {
  display: grid;
  gap: 16px;
}

.workflow-toolbar {
  display: grid;
  gap: 14px;
}

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

.mini-metric {
  border: 1px solid #e4ebf3;
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.mini-metric span {
  display: block;
  font-size: 12px;
  color: #6b7b8d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mini-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  color: #24334a;
}

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

.field.compact span {
  margin-bottom: 6px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.08fr) minmax(0, 1.22fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.workflow-table-shell {
  max-height: 720px;
}

.document-preview {
  width: 100%;
  min-height: 900px;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background: #eef3ea;
  display: block;
}

.workflow-media-shell {
  margin-top: 16px;
  border: 1px solid #e3eaf3;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f9fbff);
}

.panel-head.nested {
  margin-bottom: 10px;
}

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

.workflow-media-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  padding: 12px 14px;
  background: #ffffff;
}

.workflow-media-card strong {
  display: block;
  color: #24334a;
}

.workflow-media-card small {
  display: block;
  color: #6a788a;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.empty-media {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f4f7fb;
  color: #617086;
}

.hash-chain-panel {
  margin-top: 16px;
}

.audit-summary {
  margin-bottom: 14px;
}

.hash-chain-canvas {
  display: block;
}

.hash-scene {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.95fr);
  gap: 18px;
  padding: 18px;
  border-radius: 24px;
  color: #d8f7ff;
  background:
    radial-gradient(circle at top center, rgba(45, 230, 255, 0.18), transparent 24%),
    radial-gradient(circle at bottom center, rgba(54, 119, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #05111f 0%, #081626 100%);
  border: 1px solid rgba(96, 220, 255, 0.24);
  box-shadow: inset 0 0 0 1px rgba(96, 220, 255, 0.08), 0 24px 44px rgba(3, 13, 24, 0.28);
}

.hash-scene.hash-scene-root {
  grid-template-columns: minmax(0, 2.2fr) minmax(300px, 0.72fr);
  gap: 14px;
}

.hash-reference-root {
  display: grid;
  gap: 14px;
}

.hash-live-root {
  display: grid;
  gap: 12px;
}

.hash-live-frame {
  position: relative;
  width: 100%;
  min-height: 760px;
  border-radius: 22px;
  overflow: hidden;
  background: #020914;
  border: 1px solid rgba(90, 212, 255, 0.18);
  box-shadow: 0 24px 44px rgba(3, 13, 24, 0.28);
}

.hash-live-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #020914;
}

.hash-live-help {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: #8fc2d3;
  font-size: 13px;
}

.hash-reference-hotspot {
  position: absolute;
  border: 0;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(95, 228, 255, 0);
  transition: box-shadow 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.hash-reference-hotspot:hover,
.hash-reference-hotspot.selected {
  box-shadow: inset 0 0 0 2px rgba(117, 245, 255, 0.9), 0 0 0 1px rgba(117, 245, 255, 0.24);
  background: rgba(117, 245, 255, 0.08);
}

.hash-reference-hotspot.missing {
  opacity: 0.4;
}

.hash-reference-hotspot.field-feature { left: 1.6%; top: 10.5%; width: 11.5%; height: 20.4%; }
.hash-reference-hotspot.field-branch { left: 15.7%; top: 12.8%; width: 15.2%; height: 12.6%; }

.hash-reference-hotspot.mill-feature { left: 1.6%; top: 29.6%; width: 11.5%; height: 18.8%; }
.hash-reference-hotspot.mill-branch { left: 15.7%; top: 31.0%; width: 15.2%; height: 12.2%; }

.hash-reference-hotspot.bottling-feature { left: 1.6%; top: 49.9%; width: 11.5%; height: 18.4%; }
.hash-reference-hotspot.bottling-branch { left: 15.7%; top: 50.9%; width: 15.2%; height: 12.2%; }

.hash-reference-hotspot.warehouse-feature { left: 1.6%; top: 69.7%; width: 11.5%; height: 18.8%; }
.hash-reference-hotspot.warehouse-branch { left: 15.7%; top: 71.0%; width: 15.2%; height: 12.2%; }

.hash-reference-hotspot.transport-branch { left: 67.1%; top: 12.8%; width: 15.2%; height: 12.6%; }
.hash-reference-hotspot.transport-feature { left: 82.9%; top: 10.2%; width: 11.8%; height: 20.8%; }

.hash-reference-hotspot.export-branch { left: 67.1%; top: 30.8%; width: 15.2%; height: 12.4%; }
.hash-reference-hotspot.export-feature { left: 82.9%; top: 29.7%; width: 11.8%; height: 18.8%; }

.hash-reference-hotspot.import-branch { left: 67.1%; top: 47.1%; width: 15.2%; height: 12.2%; }
.hash-reference-hotspot.import-feature { left: 82.9%; top: 46.0%; width: 11.8%; height: 18.6%; }

.hash-reference-hotspot.retail-branch { left: 67.1%; top: 63.6%; width: 15.2%; height: 12.0%; }
.hash-reference-hotspot.retail-feature { left: 82.9%; top: 62.6%; width: 11.8%; height: 18.4%; }

.hash-reference-hotspot.quality-supplemental,
.hash-reference-hotspot.admin-supplemental {
  display: none;
}

.hash-reference-help {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: #8fc2d3;
  font-size: 13px;
}

.hash-reference-supplemental {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hash-root-detail {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.hash-root-branch-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.hash-root-branch-btn {
  justify-content: center;
}

.hash-root-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hash-root-feature-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 11px;
  border: 1px solid rgba(98, 224, 255, 0.22);
  background: rgba(7, 24, 37, 0.58);
  color: #e8fcff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hash-scene-main,
.hash-scene-sidebar {
  min-width: 0;
}

.hash-scene-sidebar {
  display: grid;
  gap: 14px;
}

.hash-root-banner,
.hash-detail-panel,
.hash-dna-panel,
.hash-legend-panel {
  border-radius: 20px;
  border: 1px solid rgba(84, 220, 255, 0.26);
  background: linear-gradient(180deg, rgba(7, 24, 39, 0.94), rgba(4, 17, 30, 0.96));
  box-shadow: inset 0 0 0 1px rgba(86, 215, 255, 0.08), 0 12px 28px rgba(2, 9, 18, 0.28);
}

.hash-root-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 16px;
}

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

.hash-root-label,
.hash-detail-head p {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #74d8ef;
}

.hash-root-banner strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: #ebfdff;
  overflow-wrap: anywhere;
}

.hash-root-banner small {
  max-width: 250px;
  text-align: right;
  color: #a8d9e7;
}

.hash-branch-scene {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px minmax(220px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.hash-root-hero {
  display: grid;
  grid-template-columns: minmax(190px, 0.56fr) minmax(620px, 2fr) minmax(190px, 0.56fr);
  gap: 6px;
  align-items: stretch;
}

.hash-root-side {
  display: grid;
  gap: 6px;
  align-content: start;
  padding-top: 18px;
}

.hash-root-row {
  position: relative;
  display: grid;
  gap: 8px;
  align-items: center;
}

.hash-root-row.left {
  grid-template-columns: minmax(112px, 0.72fr) minmax(0, 0.86fr);
}

.hash-root-row.right {
  grid-template-columns: minmax(0, 0.86fr) minmax(112px, 0.72fr);
}

.hash-root-row.left::after,
.hash-root-row.right::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 208px;
  height: 5px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(117, 245, 255, 0.84), rgba(71, 212, 255, 0.18));
  box-shadow: 0 0 18px rgba(89, 234, 255, 0.66);
  pointer-events: none;
}

.hash-root-row.left::after {
  right: -208px;
}

.hash-root-row.right::after {
  left: -208px;
  transform: translateY(-50%) scaleX(-1);
}

.hash-root-feature-stack,
.hash-root-feature-grid {
  display: grid;
  gap: 8px;
}

.hash-root-feature-stack {
  position: relative;
}

.hash-root-row.left .hash-root-feature-stack::after,
.hash-root-row.right .hash-root-feature-stack::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 20px;
  height: 3px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(97, 229, 255, 0.8), rgba(97, 229, 255, 0.22));
  box-shadow: 0 0 12px rgba(91, 236, 255, 0.48);
}

.hash-root-row.left .hash-root-feature-stack::after {
  right: -20px;
}

.hash-root-row.right .hash-root-feature-stack::after {
  left: -20px;
  transform: translateY(-50%) scaleX(-1);
}

.hash-root-feature-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 10px;
  border: 1px solid rgba(98, 224, 255, 0.22);
  background: rgba(7, 24, 37, 0.58);
  box-shadow: inset 0 0 0 1px rgba(89, 214, 255, 0.05), 0 6px 12px rgba(1, 9, 16, 0.12);
  color: #e8fcff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hash-root-feature-chip.detail {
  min-height: 0;
}

.hash-root-stage {
  position: relative;
  min-height: 980px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 14%, rgba(101, 244, 255, 0.16), transparent 16%),
    radial-gradient(circle at 50% 88%, rgba(65, 126, 255, 0.16), transparent 22%),
    linear-gradient(180deg, rgba(4, 11, 22, 0.02), rgba(3, 10, 18, 0));
}

.hash-root-tree-glow {
  position: absolute;
  inset: 18px;
  background:
    radial-gradient(circle at 50% 12%, rgba(134, 255, 255, 0.18), transparent 14%),
    radial-gradient(circle at 50% 90%, rgba(61, 135, 255, 0.16), transparent 18%);
  filter: blur(8px);
}

.hash-root-tree-art {
  position: absolute;
  inset: 6px 0 0;
  pointer-events: none;
}

.hash-tree-svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: scale(1.42) translateY(28px);
  transform-origin: 50% 56%;
}

.tree-base-ring {
  fill: none;
  stroke: rgba(78, 201, 255, 0.34);
  stroke-width: 2;
}

.tree-base-ring.faint {
  stroke-opacity: 0.42;
}

.tree-core-line,
.tree-core-line.soft,
.tree-helix-a,
.tree-helix-b,
.tree-branch,
.tree-root,
.tree-rung {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tree-core-line,
.tree-core-line.soft,
.tree-helix-a,
.tree-helix-b {
  stroke: url(#treeCoreGradient);
}

.tree-core-line {
  stroke-width: 16;
  opacity: 0.9;
}

.tree-core-line.soft {
  stroke-width: 9;
  opacity: 0.82;
}

.tree-helix-a,
.tree-helix-b {
  stroke-width: 6;
  opacity: 0.9;
}

.tree-branch {
  stroke: url(#treeBranchGradient);
  stroke-width: 5;
  opacity: 0.88;
}

.tree-root {
  stroke: url(#treeBranchGradient);
  stroke-width: 4;
  opacity: 0.86;
}

.tree-rung {
  stroke: rgba(215, 255, 255, 0.8);
  stroke-width: 3;
}

.tree-leaf {
  fill: rgba(108, 255, 196, 0.88);
  filter: drop-shadow(0 0 6px rgba(91, 255, 190, 0.62));
}

.hash-root-tree-core,
.hash-root-tree-helix,
.hash-root-stage-badge {
  display: none;
}

.hash-root-branch-node {
  position: relative;
  min-height: 78px;
  border-radius: 18px;
  border: 1px solid rgba(99, 223, 255, 0.26);
  background: rgba(8, 27, 40, 0.74);
  color: #effcff;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(1, 10, 18, 0.14), inset 0 0 0 1px rgba(96, 220, 255, 0.05);
}

.hash-root-branch-node:hover,
.hash-root-branch-node.selected {
  border-color: rgba(119, 238, 255, 0.62);
  box-shadow: 0 16px 28px rgba(1, 12, 22, 0.2), 0 0 0 1px rgba(111, 235, 255, 0.16);
}

.hash-root-branch-node.field { border-left: 4px solid #6ee4a0; }
.hash-root-branch-node.mill { border-left: 4px solid #83d9ff; }
.hash-root-branch-node.bottling { border-left: 4px solid #a0d7ff; }
.hash-root-branch-node.warehouse { border-left: 4px solid #d0f0ff; }
.hash-root-branch-node.transport { border-left: 4px solid #8de9ff; }
.hash-root-branch-node.trade { border-left: 4px solid #83b8ff; }
.hash-root-branch-node.quality { border-left: 4px solid #7df1d6; }
.hash-root-branch-node.retail { border-left: 4px solid #98e4ff; }
.hash-root-branch-node.admin { border-left: 4px solid #ffd670; }
.hash-root-branch-node.generic { border-left: 4px solid #89b8cf; }

.hash-root-branch-code,
.hash-root-branch-copy strong,
.hash-root-branch-copy small {
  display: block;
}

.hash-root-branch-code {
  margin-bottom: 8px;
  color: #79d5ea;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hash-root-branch-copy strong {
  font-size: 14px;
  line-height: 1.2;
}

.hash-root-branch-copy small {
  margin-top: 5px;
  color: #9bcddd;
  font-size: 10px;
  line-height: 1.35;
}

.hash-branch-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.hash-trunk-column {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
}

.hash-trunk-core {
  position: relative;
  width: 120px;
  height: 100%;
  min-height: 540px;
  display: grid;
  place-items: center;
}

.hash-trunk-core.small {
  min-height: 360px;
}

.hash-trunk-glow {
  position: absolute;
  inset: 12px auto 12px auto;
  width: 20px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(170, 255, 255, 0.96), rgba(54, 245, 255, 0.84), rgba(56, 104, 255, 0.72));
  box-shadow:
    0 0 16px rgba(86, 234, 255, 0.95),
    0 0 32px rgba(67, 178, 255, 0.68),
    0 0 56px rgba(46, 132, 255, 0.46);
}

.hash-trunk-rungs {
  position: absolute;
  inset: 28px auto 28px auto;
  width: 76px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.hash-trunk-rungs span {
  width: 76px;
  height: 3px;
  border-radius: 999px;
  background: rgba(214, 253, 255, 0.86);
  box-shadow: 0 0 12px rgba(102, 231, 255, 0.72);
}

.hash-trunk-badge {
  position: relative;
  z-index: 1;
  max-width: 168px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(104, 225, 255, 0.34);
  background: rgba(7, 26, 41, 0.9);
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #eafcff;
  box-shadow: 0 12px 24px rgba(3, 11, 19, 0.32);
}

.hash-trunk-caption {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #79cce1;
}

.chain-branch-card {
  position: relative;
  border: 1px solid rgba(93, 214, 255, 0.26);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 29, 44, 0.96), rgba(6, 20, 33, 0.98));
  padding: 16px 16px 16px 18px;
  color: #ecfbff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(1, 9, 16, 0.26);
}

.chain-branch-card::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, rgba(84, 230, 255, 0.8), rgba(84, 230, 255, 0.18));
  box-shadow: 0 0 12px rgba(84, 230, 255, 0.6);
}

.chain-branch-card.left::after {
  right: -28px;
}

.chain-branch-card.right::after {
  left: -28px;
  transform: scaleX(-1);
}

.chain-branch-card:hover,
.chain-branch-card.selected {
  border-color: rgba(119, 238, 255, 0.58);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(1, 14, 24, 0.34), 0 0 0 1px rgba(111, 235, 255, 0.18);
}

.hash-root-row .chain-branch-card {
  min-height: 128px;
}

.chain-branch-card.field { border-left: 4px solid #6ee4a0; }
.chain-branch-card.mill { border-left: 4px solid #83d9ff; }
.chain-branch-card.bottling { border-left: 4px solid #a0d7ff; }
.chain-branch-card.warehouse { border-left: 4px solid #d0f0ff; }
.chain-branch-card.transport { border-left: 4px solid #8de9ff; }
.chain-branch-card.trade { border-left: 4px solid #83b8ff; }
.chain-branch-card.quality { border-left: 4px solid #7df1d6; }
.chain-branch-card.retail { border-left: 4px solid #98e4ff; }
.chain-branch-card.admin { border-left: 4px solid #ffd670; }
.chain-branch-card.generic { border-left: 4px solid #89b8cf; }

.chain-branch-code,
.chain-branch-copy strong,
.chain-branch-copy small,
.chain-branch-meta span,
.chain-branch-meta code {
  display: block;
}

.chain-branch-code {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #77d4e8;
  margin-bottom: 10px;
}

.chain-branch-copy strong {
  font-size: 18px;
  line-height: 1.2;
}

.chain-branch-copy small {
  margin-top: 5px;
  color: #9ecfe0;
}

.chain-branch-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(119, 217, 239, 0.14);
}

.chain-branch-meta span {
  color: #d4f8ff;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.chain-branch-meta code {
  margin-top: 6px;
  color: #87e6fb;
  font-family: "Fira Code", "Consolas", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.hash-root-row .chain-branch-card {
  display: none;
}

.hash-process-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.hash-process-step {
  border-radius: 16px;
  border: 1px solid rgba(90, 212, 255, 0.2);
  background: rgba(7, 24, 38, 0.82);
  padding: 12px 12px 14px;
  box-shadow: inset 0 0 0 1px rgba(86, 215, 255, 0.04);
}

.hash-process-step.accent {
  border-color: rgba(255, 191, 71, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 191, 71, 0.1), 0 0 18px rgba(255, 187, 56, 0.18);
}

.hash-process-step strong,
.hash-process-step small {
  display: block;
}

.hash-process-step strong {
  color: #f1fdff;
}

.hash-process-step small {
  margin-top: 6px;
  color: #8fc2d3;
}

.hash-detail-panel,
.hash-dna-panel,
.hash-legend-panel {
  padding: 16px;
}

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

.hash-branch-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.hash-branch-summary-cell {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(10, 29, 44, 0.82);
  border: 1px solid rgba(90, 212, 255, 0.14);
}

.hash-branch-summary-cell span,
.hash-branch-summary-cell strong {
  display: block;
}

.hash-branch-summary-cell span {
  color: #8fc1d0;
  font-size: 12px;
}

.hash-branch-summary-cell strong {
  margin-top: 5px;
  color: #f0fdff;
  overflow-wrap: anywhere;
}

.hash-root-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.hash-user-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
}

.hash-detail-head h5 {
  margin: 0;
  font-size: 18px;
  color: #f2fdff;
}

.hash-detail-timeline,
.hash-dna-list,
.hash-legend-list {
  display: grid;
  gap: 10px;
}

.hash-detail-event {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(120px, 160px);
  gap: 12px;
  align-items: center;
  padding: 12px 12px 12px 10px;
  border-radius: 16px;
  background: rgba(10, 29, 44, 0.86);
  border: 1px solid rgba(94, 220, 255, 0.16);
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.hash-detail-event.verified {
  border-left: 3px solid #58df96;
}

.hash-detail-event.broken {
  border-left: 3px solid #ff6f70;
}

.hash-detail-event.selected {
  border-color: rgba(120, 235, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(126, 240, 255, 0.16), 0 18px 36px rgba(0, 0, 0, 0.24);
}

.hash-detail-node {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #bff8ff;
  box-shadow: 0 0 14px rgba(111, 240, 255, 0.8);
}

.hash-detail-copy strong,
.hash-detail-copy small {
  display: block;
}

.hash-detail-copy strong {
  color: #effdff;
}

.hash-detail-copy small {
  margin-top: 4px;
  color: #93c6d6;
}

.hash-detail-event code,
.hash-dna-row strong,
.hash-legend-row code {
  font-family: "Fira Code", "Consolas", monospace;
}

.hash-detail-event code {
  justify-self: end;
  color: #8ee4fa;
  overflow-wrap: anywhere;
}

.hash-dna-row,
.hash-legend-row {
  display: grid;
  gap: 10px;
  align-items: start;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(10, 29, 44, 0.82);
  border: 1px solid rgba(90, 212, 255, 0.14);
}

.hash-dna-row {
  grid-template-columns: 150px minmax(0, 1fr);
}

.hash-dna-row span,
.hash-legend-row span {
  color: #8fc1d0;
}

.hash-dna-row strong {
  color: #f0fdff;
  overflow-wrap: anywhere;
}

.hash-legend-row {
  grid-template-columns: 120px minmax(0, 1fr);
}

.hash-legend-row code {
  color: #89e6fa;
}

@media (max-width: 1400px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid.top,
  .dashboard-grid.middle,
  .dashboard-grid.lower,
  .section-grid.two,
  .section-grid.data,
  .auth-grid,
  .form-grid,
  .quick-grid,
  .map-shell,
  .workflow-grid,
  .workflow-summary,
  .workflow-filters {
    grid-template-columns: 1fr;
  }

  .hash-scene {
    grid-template-columns: 1fr;
  }

  .hash-scene-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hash-process-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hash-root-hero {
    grid-template-columns: 1fr;
  }

  .hash-root-stage {
    min-height: 640px;
    order: -1;
  }

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

  .hash-root-row.left::after,
  .hash-root-row.right::after {
    width: 132px;
  }

  .hash-root-row.left::after {
    right: -132px;
  }

  .hash-root-row.right::after {
    left: -132px;
  }

  .hash-dna-row,
  .hash-legend-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .topbar {
    flex-direction: column;
  }

  .hash-branch-scene {
    grid-template-columns: 1fr;
  }

  .hash-root-side {
    grid-template-columns: 1fr;
  }

  .hash-root-row.left,
  .hash-root-row.right {
    grid-template-columns: 1fr;
  }

  .hash-root-row.left::after,
  .hash-root-row.right::after,
  .hash-root-row.left .hash-root-feature-stack::after,
  .hash-root-row.right .hash-root-feature-stack::after {
    display: none;
  }

  .hash-trunk-column {
    min-height: 180px;
    order: -1;
  }

  .hash-trunk-core {
    min-height: 180px;
    width: 100%;
  }

  .hash-trunk-glow {
    inset: 50% 18px auto 18px;
    width: auto;
    height: 16px;
    transform: translateY(-50%);
  }

  .hash-trunk-rungs {
    inset: 50% 28px auto 28px;
    width: calc(100% - 56px);
    height: 76px;
    transform: translateY(-50%);
    flex-direction: row;
  }

  .hash-trunk-rungs span {
    width: 3px;
    height: 76px;
  }

  .chain-branch-card::after {
    display: none;
  }

  .hash-scene-sidebar {
    grid-template-columns: 1fr;
  }

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

  .hash-root-stage {
    min-height: 420px;
  }
}

@media (max-width: 760px) {
  .hash-root-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hash-process-strip,
  .hash-dna-row,
  .hash-legend-row,
  .hash-detail-event {
    grid-template-columns: 1fr;
  }

  .hash-detail-event code {
    justify-self: start;
  }
}
