:root {
  color-scheme: dark;
  --void: #010503;
  --black: #030a06;
  --panel: rgba(2, 14, 8, 0.88);
  --phosphor: #00ff66;
  --phosphor-bright: #b9ffd0;
  --phosphor-dim: #2fa75e;
  --text: #d6ffe2;
  --muted: #72a783;
  --line: rgba(0, 255, 102, 0.24);
  --line-hot: rgba(0, 255, 102, 0.68);
  --warning: #ffb000;
  --danger: #ff365d;
  --shadow: 0 0 0 1px rgba(0, 255, 102, 0.05), 0 24px 80px rgba(0, 0, 0, 0.58);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--void); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 52% -10%, rgba(0, 255, 102, 0.11), transparent 40%),
    linear-gradient(180deg, rgba(0, 13, 6, 0.94), rgba(0, 3, 2, 0.99));
  color: var(--text);
  font-family: var(--mono);
  text-shadow: 0 0 12px rgba(0, 255, 102, 0.08);
}
body::after {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  content: "";
  opacity: 0.2;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(0, 0, 0, 0.22) 4px);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.matrix-background { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--void); }
#matrix-rain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.7; filter: blur(0.15px); }
.matrix-grid {
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(0, 255, 102, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 102, 0.16) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  transform: perspective(500px) rotateX(62deg) scale(1.8) translateY(18%);
  transform-origin: center bottom;
}
.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 18vh;
  opacity: 0.12;
  background: linear-gradient(transparent, rgba(0, 255, 102, 0.18), transparent);
  animation: scan 10s linear infinite;
}

.topbar {
  position: relative;
  z-index: 10;
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line-hot);
  background: rgba(1, 8, 4, 0.92);
  box-shadow: 0 0 30px rgba(0, 255, 102, 0.08);
  backdrop-filter: blur(16px);
}
.topbar::after {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 28%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--phosphor), transparent);
  animation: dataSweep 7s linear infinite;
}
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; justify-self: start; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--phosphor);
  color: var(--phosphor);
  background: rgba(0, 255, 102, 0.05);
  box-shadow: inset 0 0 16px rgba(0, 255, 102, 0.09), 0 0 14px rgba(0, 255, 102, 0.12);
  font-weight: 900;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}
.brand strong, .brand small { display: block; }
.brand strong { color: var(--phosphor-bright); letter-spacing: 0.2em; font-size: 0.86rem; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; }
.system-readout { display: flex; gap: 24px; color: var(--phosphor-dim); font-size: 0.6rem; letter-spacing: 0.12em; }
.system-readout span::before { content: "● "; color: var(--phosphor); animation: pulse 2.4s ease-in-out infinite; }
.session-controls { justify-self: end; align-items: center; gap: 16px; color: var(--phosphor-dim); font-size: 0.72rem; }
#user-email::before { content: "OPERATOR // "; color: var(--muted); }

main { position: relative; z-index: 2; width: min(1500px, calc(100% - 40px)); margin: 0 auto; padding: clamp(48px, 6vw, 92px) 0; }
.login-panel { max-width: 900px; min-height: calc(100vh - 170px); display: flex; flex-direction: column; justify-content: center; padding: 4vh 0 12vh; }
.login-panel[hidden] { display: none; }
.login-panel h1, .hero h1 {
  margin: 12px 0 24px;
  color: var(--text);
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.075em;
  text-transform: uppercase;
}
.login-panel h1 span { color: transparent; -webkit-text-stroke: 1px var(--phosphor); text-shadow: 0 0 22px rgba(0, 255, 102, 0.28); }
.login-panel .lede { max-width: 710px; color: var(--muted); font-size: 0.95rem; line-height: 1.8; }
.eyebrow { margin: 0; color: var(--phosphor); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.eyebrow::before { content: "> "; }
.fine-print { margin-top: 20px; color: var(--phosphor-dim); font-size: 0.67rem; letter-spacing: 0.06em; }

.button {
  min-height: 42px;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  padding: 11px 20px;
  color: var(--phosphor);
  background: rgba(0, 255, 102, 0.04);
  font-size: 0.71rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.button:hover:not(:disabled) { color: var(--black); background: var(--phosphor); box-shadow: 0 0 24px rgba(0, 255, 102, 0.35); transform: translateY(-1px); }
.button:focus-visible { outline: 1px solid var(--phosphor-bright); outline-offset: 4px; }
.button:disabled { opacity: 0.3; filter: saturate(0.2); }
.button-primary { color: var(--black); background: var(--phosphor); box-shadow: 0 0 24px rgba(0, 255, 102, 0.16); }
.button-secondary { color: var(--phosphor); background: transparent; }
.login-panel .button { align-self: flex-start; margin-top: 28px; min-height: 50px; padding-inline: 27px; }

.hero { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 38px; }
.hero h1 { max-width: 970px; margin-bottom: 10px; font-size: clamp(3rem, 5.8vw, 6rem); }
.hero > div > p:last-child { margin: 0; color: var(--muted); font-size: 0.8rem; }
.terminal-cursor { color: var(--phosphor); animation: blink 1s steps(1) infinite; }
.safety-note {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 260px;
  padding: 16px 19px;
  border: 1px solid rgba(255, 176, 0, 0.45);
  background: rgba(20, 14, 0, 0.72);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.safety-note strong, .safety-note small { display: block; }
.safety-note strong { color: #ffca52; font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; }
.safety-note small { margin-top: 5px; color: #b98a35; font-size: 0.64rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 5px rgba(255,176,0,.1), 0 0 16px rgba(255,176,0,.5); animation: pulse 2s ease-in-out infinite; }

.workspace-grid { display: grid; grid-template-columns: minmax(390px, 0.9fr) minmax(500px, 1.1fr); gap: 20px; align-items: start; }
.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(145deg, rgba(4, 20, 10, 0.94), rgba(1, 8, 4, 0.9));
  box-shadow: var(--shadow), inset 0 0 70px rgba(0, 255, 102, 0.018);
  clip-path: polygon(0 0, calc(100% - 17px) 0, 100% 17px, 100% 100%, 17px 100%, 0 calc(100% - 17px));
  backdrop-filter: blur(15px);
}
.panel::before { position: absolute; top: 0; left: 0; width: 32%; height: 2px; content: ""; background: linear-gradient(90deg, var(--phosphor), transparent); box-shadow: 0 0 14px var(--phosphor); }
.panel::after { position: absolute; right: 18px; bottom: 12px; content: attr(data-panel); color: rgba(0, 255, 102, 0.25); font-size: 0.54rem; letter-spacing: 0.16em; }
.panel-heading { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 28px; }
.panel-heading h2 { margin: 0 0 6px; color: var(--phosphor-bright); font-size: 1.05rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 0.7rem; }
.step { padding-top: 2px; color: var(--phosphor); font-size: 0.68rem; font-weight: 750; white-space: nowrap; }
.queue-heading .icon-button { margin-left: auto; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line-hot); border-radius: 0; color: var(--phosphor); background: rgba(0, 255, 102, 0.03); font-size: 1.2rem; transition: background 150ms ease, box-shadow 150ms ease; }
.icon-button:hover { background: rgba(0, 255, 102, 0.15); box-shadow: 0 0 17px rgba(0, 255, 102, 0.2); }
.icon-button:focus-visible { outline: 1px solid var(--phosphor-bright); outline-offset: 3px; }

form { display: grid; gap: 19px; }
label { position: relative; display: grid; gap: 8px; color: var(--phosphor-dim); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
label::before { position: absolute; content: ">"; transform: translateX(-13px); color: rgba(0, 255, 102, 0.38); }
label span { color: #4d7559; font-weight: 500; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(0, 255, 102, 0.23);
  border-radius: 0;
  outline: none;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(0, 3, 1, 0.82);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
input::placeholder, textarea::placeholder { color: #3e6b4c; opacity: 0.72; }
input:focus, textarea:focus, select:focus { border-color: var(--phosphor); background: rgba(0, 13, 5, 0.95); box-shadow: 0 0 0 1px rgba(0, 255, 102, 0.14), 0 0 22px rgba(0, 255, 102, 0.08), inset 0 0 22px rgba(0, 255, 102, 0.025); }
input:disabled, textarea:disabled, select:disabled { color: #42604b; border-color: rgba(83, 122, 94, 0.18); opacity: 0.72; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.split-fields { display: grid; grid-template-columns: 0.58fr 1.42fr; gap: 14px; }
.submit-button { justify-self: start; margin-top: 5px; }

.message { border-left: 2px solid var(--phosphor); padding: 12px 14px; color: var(--phosphor-dim); background: rgba(0, 255, 102, 0.045); font-size: 0.72rem; line-height: 1.55; }
.message::before { content: "SYSTEM // "; color: var(--phosphor); font-weight: 800; }
.message.error { border-color: var(--danger); color: #ff8aa0; background: rgba(255, 54, 93, 0.06); }
.message.error::before { content: "ERROR // "; color: var(--danger); }
.request-list { display: grid; gap: 13px; }
.request-card { position: relative; border: 1px solid var(--line); padding: 18px; background: rgba(0, 5, 2, 0.62); }
.request-card::before { position: absolute; top: -1px; left: -1px; width: 6px; height: 6px; border-top: 1px solid var(--phosphor); border-left: 1px solid var(--phosphor); content: ""; }
.request-card-header { display: flex; justify-content: space-between; gap: 16px; }
.request-card h3 { margin: 0; color: var(--phosphor-bright); font-size: 0.9rem; }
.request-meta { margin: 6px 0 0; color: var(--muted); font-size: 0.65rem; }
.request-description { margin: 16px 0; color: #9acbaa; font-size: 0.76rem; line-height: 1.6; white-space: pre-wrap; }
.status-badge { align-self: start; border: 1px solid var(--line); padding: 6px 9px; color: var(--phosphor-dim); background: rgba(0, 255, 102, 0.04); font-size: 0.57rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.status-badge.approved { border-color: var(--phosphor); color: var(--phosphor); }
.status-badge.cancelled { border-color: rgba(255, 54, 93, 0.3); color: #b66979; }
.request-actions { display: flex; align-items: center; gap: 9px; }
.request-actions a { color: var(--phosphor); font-size: 0.68rem; text-underline-offset: 4px; }
.request-actions button { border: 1px solid var(--line); border-radius: 0; padding: 7px 11px; color: var(--phosphor-dim); background: transparent; font-size: 0.63rem; font-weight: 750; text-transform: uppercase; }
.request-actions .approve { border-color: var(--phosphor); color: var(--black); background: var(--phosphor); }
.empty-state { padding: 92px 20px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; border: 1px solid var(--line); color: var(--phosphor); background: rgba(0, 255, 102, 0.035); box-shadow: 0 0 25px rgba(0, 255, 102, 0.06); font-size: 0.92rem; }
.empty-state h3 { margin: 0 0 8px; color: var(--phosphor-bright); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; }
.empty-state p { margin: 0; font-size: 0.7rem; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #010503; }
::-webkit-scrollbar-thumb { border: 2px solid #010503; background: #155c30; }
::selection { color: var(--black); background: var(--phosphor); }

@keyframes blink { 0%, 46% { opacity: 1; } 47%, 100% { opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes scan { from { transform: translateY(-25vh); } to { transform: translateY(125vh); } }
@keyframes dataSweep { from { transform: translateX(-120%); } to { transform: translateX(460%); } }

@media (max-width: 1050px) {
  .system-readout { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .workspace-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 600px) {
  main { width: min(100% - 24px, 1500px); padding-top: 38px; }
  .topbar { padding: 12px 14px; }
  #user-email { display: none; }
  .brand small { display: none; }
  .split-fields { grid-template-columns: 1fr; }
  .panel { padding: 24px 19px; }
  .hero h1 { font-size: clamp(2.7rem, 16vw, 4.2rem); }
  .safety-note { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  #matrix-rain { opacity: 0.3; }
}
