:root {
  color-scheme: dark;
  --ink: #f4f8fb;
  --muted: #9dafbb;
  --line: rgba(148, 163, 184, 0.22);
  --panel: rgba(13, 22, 30, 0.88);
  --panel-strong: rgba(7, 13, 20, 0.94);
  --bg: #070c12;
  --accent: #0085ca;
  --accent-bright: #2eb8ff;
  --cyan: #57d6d4;
  --green: #40d38d;
  --warning: #f3b84a;
  --danger: #ff7b72;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 8%, rgba(0, 133, 202, 0.28), transparent 28%),
    radial-gradient(circle at 86% 2%, rgba(87, 214, 212, 0.16), transparent 26%),
    linear-gradient(135deg, #05070a 0%, #09131d 48%, #0c1118 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 78%);
}

.app-shell {
  position: relative;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.brand-mark {
  width: min(260px, 52vw);
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 9px 12px;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.32));
}

.version-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.version-stack span,
.status-pill {
  border: 1px solid rgba(46, 184, 255, 0.32);
  border-radius: 999px;
  background: rgba(0, 133, 202, 0.13);
  color: #dff6ff;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.toolbar,
.summary-band,
.panel,
.metric,
.status {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-radius: 8px;
  border-top-color: rgba(46, 184, 255, 0.45);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 0.95;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.hero-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 600;
}

.lookup-form {
  width: min(580px, 100%);
}

.lookup-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto auto;
  gap: 10px;
}

input,
select,
button {
  min-height: 48px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 13px;
  color: var(--ink);
  font-weight: 800;
  outline: none;
}

select {
  appearance: none;
}

input:focus,
select:focus {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(46, 184, 255, 0.16);
}

option {
  background: #07131f;
  color: var(--ink);
}

button {
  border: 1px solid rgba(46, 184, 255, 0.48);
  padding: 0 22px;
  background: linear-gradient(135deg, var(--accent), #12a1ee);
  color: white;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(0, 133, 202, 0.26);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-action {
  border-color: rgba(87, 214, 212, 0.42);
  background: rgba(87, 214, 212, 0.1);
  color: #eaffff;
  box-shadow: none;
}

.nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 48px;
  padding: 0;
}

.button-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #dff6ff;
  font-weight: 800;
}

.status.loading {
  position: relative;
  overflow: hidden;
  border-color: rgba(87, 214, 212, 0.48);
  background:
    linear-gradient(90deg, rgba(0, 133, 202, 0.16), rgba(87, 214, 212, 0.08)),
    var(--panel);
}

.status.loading::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(87, 214, 212, 0.18), transparent);
  animation: status-sweep 1.35s linear infinite;
}

.loading-rig {
  position: relative;
  z-index: 1;
  display: inline-grid;
  grid-template-columns: repeat(3, 8px);
  gap: 5px;
  align-items: center;
}

.loading-rig span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(87, 214, 212, 0.72);
  animation: loading-pop 0.8s ease-in-out infinite;
}

.loading-rig span:nth-child(2) {
  animation-delay: 0.12s;
}

.loading-rig span:nth-child(3) {
  animation-delay: 0.24s;
}

.loading-mascot {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.42));
  transform-origin: bottom center;
  animation: mascot-dash 1.4s ease-in-out infinite;
}

.status.loading > span {
  position: relative;
  z-index: 1;
}

.loading-punchline {
  margin-left: auto;
  color: var(--cyan);
  font-size: 12px;
  text-transform: uppercase;
}

.status.error {
  border-color: rgba(255, 123, 114, 0.55);
  color: #ffd8d4;
}

@keyframes loading-pop {
  0%,
  100% {
    transform: translateY(0) scale(0.8);
    opacity: 0.58;
  }

  50% {
    transform: translateY(-5px) scale(1.1);
    opacity: 1;
  }
}

@keyframes status-sweep {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

@keyframes mascot-dash {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-7px) rotate(5deg);
  }
}

.summary-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(13, 22, 30, 0.94), rgba(0, 133, 202, 0.12));
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
}

.status-pill {
  flex: 0 0 auto;
  color: #ffffff;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.dates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.metric,
.date-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 18px 22px;
}

.metric::after,
.date-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 72px;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--accent-bright));
}

.date-card {
  border: 1px solid var(--line);
  background: rgba(7, 13, 20, 0.68);
  box-shadow: var(--shadow);
}

.metric span,
.date-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong,
.date-card strong {
  display: block;
  color: white;
  overflow-wrap: anywhere;
  font-size: clamp(17px, 2vw, 29px);
  line-height: 1.1;
}

.fit-money {
  overflow-wrap: normal;
  white-space: nowrap;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
  margin-top: 16px;
}

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

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

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

.load-revenue {
  min-width: 180px;
  border: 1px solid rgba(87, 214, 212, 0.34);
  border-radius: 8px;
  background: rgba(87, 214, 212, 0.08);
  padding: 12px 14px;
  text-align: right;
}

.load-revenue span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.load-revenue strong {
  color: white;
  font-size: 20px;
}

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.busy-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 10px;
  min-height: 190px;
  margin-top: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.busy-bar {
  display: grid;
  grid-template-rows: 24px 1fr 22px;
  align-items: end;
  min-width: 0;
  text-align: center;
}

.bar-value {
  color: #dff6ff;
  font-size: 12px;
  font-weight: 900;
}

.bar-fill {
  display: block;
  width: 100%;
  height: var(--height);
  min-height: 8px;
  border: 1px solid rgba(46, 184, 255, 0.48);
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, rgba(87, 214, 212, 0.95), rgba(0, 133, 202, 0.82));
  box-shadow: 0 14px 26px rgba(0, 133, 202, 0.22);
}

.bar-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-chart {
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
}

.busy-table-wrap table {
  min-width: 900px;
}

.project-jobs-table th,
.project-jobs-table td {
  text-align: left;
}

.compare-form {
  width: min(720px, 100%);
}

.compare-lookup-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.compare-lookup-grid label {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.compare-job-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.compare-job-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 13, 20, 0.68);
  box-shadow: var(--shadow);
  padding: 18px;
}

.compare-job-card h3 {
  margin-bottom: 8px;
  color: white;
  font-size: 22px;
  line-height: 1.15;
}

.compare-table th,
.compare-table td {
  text-align: right;
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
}

.positive-delta {
  color: var(--green);
  font-weight: 900;
}

.negative-delta {
  color: var(--danger);
  font-weight: 900;
}

.breakout-card-header,
.breakout-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.breakout-card-header {
  margin-bottom: 14px;
}

.breakout-card-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.breakout-card-header strong {
  color: white;
  font-size: 22px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
  white-space: normal;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  color: #eaf3f7;
}

.product-name {
  display: inline-block;
  margin-right: 8px;
}

.row-badge {
  display: inline-block;
  margin: 3px 6px 0 0;
  border: 1px solid rgba(87, 214, 212, 0.42);
  border-radius: 999px;
  background: rgba(87, 214, 212, 0.1);
  color: #c9fffb;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.empty-cell {
  padding: 22px 10px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.job-link {
  color: #dff6ff;
  font-weight: 900;
  text-decoration: none;
}

.job-link:hover {
  color: white;
  text-decoration: underline;
  text-decoration-color: var(--accent-bright);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.total-row {
  background: rgba(0, 133, 202, 0.18);
  font-weight: 900;
}

.detail-list {
  margin: 0;
}

.detail-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.detail-list div:last-child {
  border-bottom: 0;
}

.auth-shell {
  width: min(760px, calc(100% - 32px));
}

.auth-panel {
  margin-top: 18px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.auth-result {
  margin-top: 18px;
  border: 1px solid rgba(87, 214, 212, 0.28);
  border-radius: 8px;
  background: rgba(7, 13, 20, 0.68);
  padding: 14px;
}

.auth-result strong {
  display: block;
  margin-bottom: 8px;
  color: white;
  font-size: 18px;
}

.auth-result pre {
  overflow-x: auto;
  margin: 0;
  color: #dff6ff;
  font: 800 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.mascot-egg {
  position: fixed;
  right: max(18px, calc((100vw - 1240px) / 2));
  bottom: 18px;
  z-index: 30;
  display: grid;
  grid-template-columns: 190px minmax(210px, 300px);
  align-items: end;
  gap: 10px;
  pointer-events: none;
}

.mascot-egg[hidden] {
  display: none;
}

.mascot-egg img {
  width: 200px;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.46));
  transform-origin: bottom center;
}

.avm-egg {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 80;
  display: grid;
  place-items: center;
  width: min(420px, 72vw);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.76) rotate(-7deg);
  transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.2, 1.35, 0.25, 1);
}

.avm-egg.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.avm-egg img {
  width: 100%;
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.58));
}

.mascot-pop img {
  animation: mascot-entrance 0.58s cubic-bezier(0.2, 1.4, 0.3, 1);
}

.mascot-egg[data-mood="run"] img {
  animation: mascot-run 0.9s ease-in-out infinite;
}

.mascot-bubble {
  position: relative;
  margin-bottom: 34px;
  border: 1px solid rgba(87, 214, 212, 0.42);
  border-radius: 8px;
  background: rgba(7, 13, 20, 0.94);
  color: white;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.3;
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.mascot-bubble::before {
  position: absolute;
  left: -9px;
  bottom: 22px;
  width: 16px;
  height: 16px;
  border-bottom: 1px solid rgba(87, 214, 212, 0.42);
  border-left: 1px solid rgba(87, 214, 212, 0.42);
  background: rgba(7, 13, 20, 0.94);
  content: "";
  transform: rotate(45deg);
}

.mascot-close {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 32px;
  width: 32px;
  border-radius: 999px;
  padding: 0;
  background: rgba(0, 133, 202, 0.92);
  pointer-events: auto;
}

.destination-dialog {
  width: min(430px, calc(100% - 32px));
  border: 1px solid rgba(46, 184, 255, 0.42);
  border-radius: 8px;
  background: rgba(7, 13, 20, 0.98);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow);
}

.destination-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
}

.destination-dialog form {
  padding: 22px;
}

.destination-dialog h3 {
  margin-bottom: 18px;
}

.destination-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.destination-cancel {
  width: 100%;
  margin-top: 12px;
}

@keyframes mascot-entrance {
  from {
    opacity: 0;
    transform: translateY(40px) rotate(-10deg) scale(0.82);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes mascot-run {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-8px) rotate(4deg);
  }
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
  color: white;
  text-align: right;
  font-weight: 900;
}

@media (max-width: 820px) {
  .toolbar,
  .summary-band {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics-grid,
  .dates-grid,
  .content-grid,
  .compare-job-grid,
  .compare-lookup-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 12px;
  }

  .top-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .version-stack {
    justify-content: start;
  }

  .mascot-egg {
    right: 10px;
    bottom: 10px;
    grid-template-columns: 130px minmax(150px, 1fr);
  }

  .mascot-egg img {
    width: 140px;
  }

  .mascot-bubble {
    margin-bottom: 18px;
    font-size: 12px;
  }

  .lookup-row {
    grid-template-columns: 1fr;
  }
}
