@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Geist:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  font: 16px/1.5 "DM Sans", system-ui, sans-serif;
  --ink: #102841;
  --muted: #425d77;
  --line: #b8cde1;
  --navy: #081a2d;
  --blue: #1859ad;
  --header-height: 76px;
  color: var(--ink);
  background: #dbe8f3;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
body:not(.workspace-open) {
  min-height: 100vh;
  background: linear-gradient(90deg, #081a2df9 5%, #09213de8 51%, #0c2d4b99 100%),
    linear-gradient(0deg, #081a2d, transparent 70%), url('/mine-aerial.jpeg') 55% center / cover;
}
body.workspace-open {
  background: linear-gradient(125deg, #e4eef8ee, #dceaf5f9), url('/mine-aerial.jpeg') center / cover fixed;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 4.5rem);
  min-height: var(--header-height);
  color: white;
  border-bottom: 1px solid #a1d1fb36;
  background: #081a2d99;
}
.workspace-open header {
  background: linear-gradient(135deg, #153755, #081a2d);
  box-shadow: 0 3px 13px #07192c30;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font: 720 1.34rem/1 Geist, system-ui, sans-serif;
  letter-spacing: -.04em;
  text-decoration: none;
  color: white;
}
.brand img { object-fit: contain; border-radius: 9px; background: white; box-shadow: 0 3px 10px #06162680; }
.brand strong { color: #a9deff; }
.account { display: flex; align-items: center; gap: 1rem; }
.layout { display: flex; min-height: calc(100vh - var(--header-height)); }
nav {
  flex: 0 0 232px;
  padding: 1.4rem 1rem;
  background: linear-gradient(158deg, #173a58, #091b2f 76%);
  border-right: 1px solid #477295;
  box-shadow: 5px 0 15px #12395c26;
}
nav button {
  display: block;
  width: 100%;
  margin: .25rem 0;
  padding: .7rem .9rem;
  text-align: left;
  color: #dcecfb;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
nav button:hover { background: #9acbff1c; }
nav button[aria-current=page] {
  color: white;
  background: linear-gradient(145deg, #2d5d87, #184469);
  border-color: #739bc2;
  box-shadow: 0 3px 9px #05142645, inset 0 1px #d7ecff3d;
}
main { flex: 1; min-width: 0; width: 100%; max-width: 1550px; padding: clamp(1rem, 4vw, 3rem); margin-inline: auto; }
h1, h2 { font-family: Geist, system-ui, sans-serif; }
h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -.055em; line-height: 1.1; }
h2 { font-size: 1.15rem; margin: 0 0 1rem; letter-spacing: -.025em; }
p { margin: .5rem 0 1rem; color: var(--muted); }

.welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 5vw, 5rem);
  min-height: min(720px, calc(100svh - var(--header-height) - 6rem));
  padding: clamp(1.2rem, 3vw, 3rem);
  color: #f0f7ff;
  overflow: clip;
}
.company { color: #aedcff; font-size: .875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.welcome h1 { margin: .25rem 0 2rem; font-size: clamp(3.15rem, 7.6vw, 7.25rem); letter-spacing: -.075em; }
.welcome h1 em { color: #a4dcff; font-style: normal; }
.access-panel { max-width: 420px; padding: 1.45rem 1.6rem; color: var(--ink); }
.access-panel h2 { margin-bottom: .4rem; }
.access-panel p:last-child, .access-panel p:has(+ [hidden]) { margin-bottom: 0; }
.welcome-visual { width: min(100%, 550px); justify-self: center; display: grid; justify-items: center; }
.orbit-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  perspective: 900px;
  transform-style: preserve-3d;
  pointer-events: none;
}
.orbit-scene::before {
  content: "";
  position: absolute;
  inset: 9%;
  background: radial-gradient(circle, #62bdff38, #0e47951b 46%, transparent 68%);
  border-radius: 50%;
}
.orbit-core, .orbit { position: absolute; inset: 0; margin: auto; }
.orbit-core {
  display: grid;
  place-items: center;
  width: 34%;
  height: 34%;
  border: 1px solid #b9e5ff;
  border-radius: 50%;
  color: white;
  background: radial-gradient(circle at 31% 22%, #9be3ff, #448dc6 30%, #1d5089 55%, #071f41 82%);
  box-shadow: inset 0 -10px 23px #02162c8a, 0 0 46px #5cbaff99, 0 22px 40px #03152abb;
  font: 800 clamp(1.4rem, 4vw, 4rem)/1 Geist, system-ui, sans-serif;
  letter-spacing: -.08em;
  text-shadow: 0 3px 10px #0b376f;
}
.orbit {
  width: var(--diameter);
  height: var(--diameter);
  transform: rotateZ(var(--plane)) rotateX(61deg);
  transform-style: preserve-3d;
}
.orbit-one { --plane: -24deg; --period: 22s; --diameter: 75%; --node-color: #8ce9ff; }
.orbit-two { --plane: 40deg; --period: 30s; --diameter: 82%; --node-color: #7ab0ff; }
.orbit-three { --plane: 100deg; --period: 36s; --diameter: 89%; --node-color: #d3efff; }
.orbit-track {
  position: absolute;
  inset: 0;
  border: 1px solid #b6e3ffb8;
  border-radius: 50%;
  box-shadow: 0 0 12px #71bfff70, inset 0 0 12px #71bfff45;
  transform-style: preserve-3d;
  animation: orbit-turn var(--period) linear infinite;
}
.orbit-node {
  position: absolute;
  top: 50%;
  left: 100%;
  width: clamp(16px, 3.1vw, 36px);
  aspect-ratio: 1;
  border: 1px solid #d9f2ffb5;
  color: var(--node-color);
  background: radial-gradient(circle at 28% 18%, #effaff, currentColor 30%, #23639d 64%, #0d2c59 91%);
  box-shadow: inset 0 1px #fff9, 0 0 16px #63beffb0;
  transform: translate(-50%, -50%) rotateX(-61deg) rotateZ(calc(-1 * var(--plane)));
  animation: orbit-upright var(--period) linear infinite;
}
.orbit-node:nth-child(2) { left: 0; width: clamp(12px, 2vw, 24px); }
.orbit-node.sphere { border-radius: 50%; }
.orbit-node.cube { border-radius: 25%; background: linear-gradient(145deg, #e3faff, currentColor 37%, #245c9d 72%, #132d55); }
.orbit-node.prism { clip-path: polygon(50% 0, 100% 42%, 50% 100%, 0 42%); background: conic-gradient(from 10deg, #fff, currentColor, #11315d, #4c9cdf, #fff); }
@keyframes orbit-turn { to { transform: rotateZ(1turn); } }
@keyframes orbit-upright {
  from { transform: translate(-50%, -50%) rotateZ(0turn) rotateX(-61deg) rotateZ(calc(-1 * var(--plane))); }
  to { transform: translate(-50%, -50%) rotateZ(-1turn) rotateX(-61deg) rotateZ(calc(-1 * var(--plane))); }
}
.orbit-paused .orbit-track, .orbit-paused .orbit-node { animation-play-state: paused; }
button, .primary {
  display: inline-block;
  padding: .5rem .85rem;
  border: 1px solid #aac4db;
  border-radius: 8px;
  color: #17466f;
  background: linear-gradient(#f9fcff, #e1effb);
  box-shadow: inset 0 1px white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.primary { color: white; background: linear-gradient(#216dc7, #164f9c); border-color: #144b95; box-shadow: 0 4px 10px #124b883d, inset 0 1px #83bafa; }
button:hover, .primary:hover { filter: brightness(1.07); }
.motion-toggle { color: #eef7ff; background: #0b2442; border-color: #769aba; box-shadow: none; font-size: .875rem; }
:focus-visible { outline: 3px solid #348ae7; outline-offset: 3px; }

.workspace-heading {
  padding: 1.4rem 1.6rem;
  border: 1px solid #7c9fbd;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(90deg, #081a2df5, #102f4edc), url('/mine-aerial.jpeg') center 52% / cover;
  box-shadow: inset 0 1px #dbedff44, 0 9px 16px #21476c40;
  margin-bottom: 1.5rem;
}
.workspace-heading p { color: #d9ecff; margin: .5rem 0 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card, .panel, .access-panel {
  border: 1px solid #fff;
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, #edf5fc);
  box-shadow: 0 5px 0 #8faac465, 0 12px 23px #244e752e;
}
.card, .panel { padding: 1.1rem 1.25rem; }
.card { transform: perspective(800px) translateZ(0); transition: transform .2s ease, box-shadow .2s ease; }
.card strong { display: block; margin-top: .25rem; font: 750 2.25rem/1.2 Geist, system-ui, sans-serif; color: var(--blue); }
.panel { margin: 1rem 0 1.35rem; }
form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 1rem; align-items: end; }
form button { justify-self: start; }
label { display: grid; gap: .3rem; font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; font: inherit; padding: .5rem; border: 1px solid var(--line); border-radius: 7px; background: white; color: inherit; }
textarea { min-height: 5rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem; border-bottom: 1px solid #d4e2ee; vertical-align: top; overflow-wrap: anywhere; }
th { font-size: .875rem; background: #e6f0fa; }
td button { margin: 0 .3rem .3rem 0; }
#status:not(:empty) { position: fixed; z-index: 2; bottom: 1rem; right: 1rem; max-width: calc(100% - 2rem); background: #102841; color: white; padding: .7rem 1rem; border-radius: 8px; }

@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: perspective(800px) translateY(-4px) rotateX(4deg); box-shadow: 0 8px 0 #8faac475, 0 16px 24px #244e7545; }
}
@media (max-width: 750px) {
  .layout { display: block; }
  nav { display: flex; gap: .35rem; overflow: auto; padding: .4rem .7rem; border-right: 0; }
  nav button { white-space: nowrap; width: auto; }
  .account span { display: none; }
  .welcome { grid-template-columns: minmax(0, 1fr); gap: .75rem; min-height: auto; padding: 1.4rem .5rem; }
  .welcome h1 { margin-bottom: 1.25rem; }
  .welcome-visual { width: min(100%, 325px); }
}
@media (prefers-reduced-motion: reduce) {
  .orbit-track, .orbit-node { animation: none; }
  .motion-toggle { display: none; }
  .card, .card:hover { transition: none; transform: none; }
}

.report-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.report-filters label { flex: 1 1 160px; max-width: 250px; }

.demo-link { display: inline-flex; margin-top: .65rem; margin-right: 0; color: #1a5489; font-weight: 700; text-underline-offset: .2em; }
#sign-in:not([hidden]) + .demo-link { margin-left: .8rem; }
.demo-banner { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem 1.25rem; padding: .85rem 1.15rem; margin-bottom: 1rem; border-radius: 10px; background: #fff1d2; border: 1px solid #d6ad55; }
.demo-banner p { margin: 0 auto .4rem 0; color: #60430d; font-weight: 700; }
.demo-banner label { min-width: 128px; }
.demo-banner .demo-link { margin-bottom: .4rem; }
