/* build: 20260314r3 */
:root {
  --bg: #020812;
  --bg-soft: #071428;
  --bg-panel: #091a34;
  --surface: #ffffff;
  --surface-soft: #f2f4f8;
  --text: #e8efff;
  --text-strong: #ffffff;
  --text-dark: #0d1524;
  --muted: #9cb0d2;
  --line: #203153;
  --line-soft: #d8dee9;
  --primary: #f1e84a;
  --primary-text: #161816;
  --accent: #2e9eff;
  --accent-strong: #216dff;
  --danger: #df3d45;
  --ok: #1fb35f;
  --warn: #f09a30;
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --radius: 14px;
}

body[data-theme="low-contrast"] {
  --bg: #0f1b2f;
  --bg-soft: #11233e;
  --bg-panel: #193158;
  --text: #dfebff;
  --muted: #afbfdd;
  --line: #2d446f;
  --primary: #d2da8f;
  --accent: #76a5e3;
  --accent-strong: #4d84d3;
}

body[data-theme="light"] {
  --bg: #edf1f8;
  --bg-soft: #f8faff;
  --bg-panel: #f4f7ff;
  --surface: #ffffff;
  --surface-soft: #f7f9fd;
  --text: #1b2a40;
  --text-strong: #0f1f35;
  --text-dark: #0f1f35;
  --muted: #65738d;
  --line: #c6d0de;
  --line-soft: #d8dee9;
  --primary: #efe146;
  --primary-text: #111;
  --accent: #2a5fd8;
  --accent-strong: #1e49ab;
  --danger: #c93241;
  --card-shadow: 0 10px 26px rgba(28, 46, 88, 0.14);
}

body[data-theme="dark"] {
  --bg: #020812;
  --bg-soft: #071428;
  --bg-panel: #091a34;
}

body[data-theme="high-contrast"] {
  --bg: #01050d;
  --bg-soft: #04112b;
  --bg-panel: #091833;
  --text: #ffffff;
  --text-strong: #ffffff;
  --muted: #c0d2f8;
  --line: #304b7f;
  --primary: #ffee55;
  --accent: #4db2ff;
  --accent-strong: #2589ff;
  --danger: #ff4d4d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Bahnschrift, "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(1300px 760px at 94% -5%, #274f91 0%, transparent 58%), var(--bg);
  color: var(--text);
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(125deg, rgba(241, 232, 74, 0.08), transparent 48%),
    linear-gradient(310deg, rgba(32, 112, 237, 0.18), transparent 44%);
}

.hidden {
  display: none !important;
}

.root {
  position: relative;
  min-height: 100vh;
}

.step-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.step-card {
  width: min(420px, 100%);
  background: linear-gradient(160deg, rgba(6, 20, 45, 0.95), rgba(3, 12, 28, 0.95));
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: grid;
  gap: 10px;
}

.step-card h1,
.step-card h2 {
  margin: 0;
  color: var(--text-strong);
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
}

.step-copy {
  margin: 0;
  color: var(--text);
}

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

.theme-picker {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 0;
}

.theme-picker legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.83rem;
}

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

.theme-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px;
  border-radius: 9px;
  font-size: 0.85rem;
  cursor: pointer;
}

.theme-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #0f1c31;
  font-size: 0.95rem;
}

.inline-status {
  min-height: 20px;
  margin: 2px 0 0;
  font-size: 0.85rem;
}

.inline-status.error {
  color: #ffb5ba;
}

.inline-status.ok {
  color: #a9f2be;
}

.workspace {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(2, 11, 27, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.icon-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 9px;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
}

.health-badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  text-transform: lowercase;
  background: #2f4467;
  color: #fff;
}

.workspace-body {
  position: relative;
  flex: 1;
  display: block;
}

.side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: linear-gradient(170deg, #071a3d, #03112a 80%);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  z-index: 40;
  padding: 74px 12px 14px;
  display: grid;
  gap: 8px;
  align-content: start;
}

body.nav-open .side-nav {
  transform: translateX(0);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  z-index: 35;
}

body.nav-open .nav-overlay {
  display: block !important;
}

.nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  text-align: left;
  padding: 11px 12px;
  font-size: 1rem;
  cursor: pointer;
}

.nav-link.active {
  border-color: var(--primary);
  background: rgba(241, 232, 74, 0.16);
}

.content {
  padding: 14px;
}

.panel {
  display: none;
  background: rgba(4, 17, 41, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

body[data-theme="light"] .panel,
body[data-theme="light"] .topbar,
body[data-theme="light"] .side-nav {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

.panel.active {
  display: block;
}

.panel h2 {
  margin: 0;
}

.panel-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar input {
  width: 210px;
}

.panel-split {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.entity-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(172deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 253, 0.98));
  box-shadow: 0 8px 18px rgba(6, 18, 38, 0.18);
  color: var(--text-dark);
  overflow: hidden;
}

.entity-card.selected {
  outline: 2px solid var(--primary);
}

.entity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 11px 6px;
}

.entity-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.entity-body {
  padding: 0 11px 10px;
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.entity-actions {
  border-top: 1px solid var(--line-soft);
  padding: 8px 10px 10px;
  display: flex;
  gap: 8px;
}

.editor-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(170deg, rgba(6, 20, 45, 0.95), rgba(3, 12, 28, 0.95));
  padding: 12px;
}

.editor-card h3 {
  margin: 0 0 10px;
}

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

.drawer-head h3 {
  margin: 0;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.48);
  z-index: 72;
}

.editor-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(460px, 100vw);
  padding: 12px;
  z-index: 73;
  background: linear-gradient(170deg, #071a3d, #03112a 80%);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  box-shadow: -16px 0 34px rgba(0, 0, 0, 0.45);
}

.editor-drawer .editor-card {
  min-height: calc(100dvh - 24px);
}

body.drawer-open {
  overflow: hidden;
}

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

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

.editor-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

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

.btn.small {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, #f7ec5f, #f1d93e);
  color: var(--primary-text);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #b52b32);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
}

.stats-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.stat-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card p {
  margin: 6px 0 0;
  color: var(--primary);
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
}

.focus-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.focus-card h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.focus-card p {
  margin: 7px 0 0;
}

.dashboard-typeahead {
  position: relative;
  margin-top: 10px;
}

.typeahead-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 25;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 20, 45, 0.98);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36);
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  gap: 1px;
}

.typeahead-item {
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.typeahead-item:hover,
.typeahead-item.selected {
  background: rgba(77, 178, 255, 0.22);
}

.typeahead-code {
  font-size: 0.74rem;
  color: #9ec0ff;
  font-weight: 700;
}

.typeahead-name {
  font-size: 0.86rem;
  color: #eef4ff;
}

.typeahead-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.timeline-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

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

.timeline-card-head h3 {
  margin: 0;
  color: var(--text-strong);
}

.timeline-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  text-align: right;
}

.timeline-sheet {
  margin-top: 10px;
}

.timeline-sheet.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
}

.timeline-sheet.loading {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.timeline-loading-shell {
  display: grid;
  gap: 10px;
}

.timeline-loading-line,
.timeline-loading-grid span {
  border-radius: 8px;
  background: linear-gradient(100deg, rgba(97, 127, 181, 0.2) 20%, rgba(157, 190, 245, 0.5) 50%, rgba(97, 127, 181, 0.2) 80%);
  background-size: 240% 100%;
  animation: timelineShimmer 1.25s linear infinite;
}

.timeline-loading-line {
  height: 16px;
}

.timeline-loading-line.short {
  width: 62%;
}

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

.timeline-loading-grid span {
  display: block;
  height: 24px;
}

@keyframes timelineShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.sheet-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 520px;
}

.timeline-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 840px;
}

.timeline-table th,
.timeline-table td {
  border-right: 1px solid rgba(165, 186, 224, 0.22);
  border-bottom: 1px solid rgba(165, 186, 224, 0.22);
  padding: 6px 8px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.timeline-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #10274f;
  color: #f3f7ff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline-table th.row-activity,
.timeline-table th.row-code {
  text-align: left;
  color: #dce8ff;
  background: rgba(8, 28, 60, 0.7);
  font-weight: 600;
}

.timeline-table tr.timeline-data-row.expanded th.row-activity,
.timeline-table tr.timeline-data-row.expanded th.row-code {
  background: rgba(20, 53, 104, 0.9);
}

.timeline-expander {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-right: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #e7f0ff;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.timeline-expander:hover {
  filter: brightness(1.1);
}

.timeline-expander-icon {
  display: inline-block;
  transform: translateY(-1px);
}

.timeline-detail-cell {
  padding: 10px;
  background: rgba(5, 18, 42, 0.95);
}

.activity-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.activity-detail-item {
  border: 1px solid rgba(168, 189, 226, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  min-width: 0;
}

.activity-detail-key {
  display: block;
  color: #9db5dc;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.activity-detail-value {
  display: block;
  margin-top: 3px;
  color: #f5f9ff;
  font-size: 0.83rem;
  overflow-wrap: anywhere;
}

.timeline-table td.sheet-cell {
  min-width: 34px;
  width: 34px;
  height: 24px;
  background: rgba(255, 255, 255, 0.03);
}

.timeline-table td.sheet-cell.on.pending {
  background: linear-gradient(140deg, rgba(245, 216, 76, 0.82), rgba(211, 170, 16, 0.92));
}

.timeline-table td.sheet-cell.on.progress {
  background: linear-gradient(140deg, rgba(77, 178, 255, 0.88), rgba(37, 137, 255, 0.95));
}

.timeline-table td.sheet-cell.on.complete {
  background: linear-gradient(140deg, rgba(59, 198, 112, 0.88), rgba(31, 179, 95, 0.95));
}

.status-line {
  margin: 12px 0 0;
  min-height: 22px;
  font-size: 0.95rem;
}

.status-line.ok {
  color: #8cf0ab;
}

.status-line.warn {
  color: #ffd485;
}

.status-line.error {
  color: #ffb8b8;
}

.support-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.support-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.support-card h3,
.support-card p {
  margin: 0;
}

.support-card p {
  margin-top: 6px;
  color: var(--muted);
}

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

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

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

}

@media (min-width: 1100px) {
  .topbar {
    padding: 14px 18px;
  }

  .workspace-body {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 14px;
    padding: 14px;
  }

  .side-nav {
    position: sticky;
    top: 75px;
    transform: none;
    width: auto;
    inset: auto;
    height: fit-content;
    border-radius: 14px;
    padding: 12px;
  }

  .icon-btn {
    display: none;
  }

  .nav-overlay {
    display: none !important;
  }

  .content {
    padding: 0;
  }

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

  .editor-drawer {
    width: min(520px, 45vw);
    padding: 16px;
  }

  .editor-drawer .editor-card {
    min-height: calc(100dvh - 32px);
  }
}
