:root {
  color-scheme: dark;
  --ink: #f6f2e9;
  --muted: #a6a197;
  --line: rgba(255, 255, 255, .12);
  --panel: rgba(18, 18, 18, .88);
  --accent: #f0b45b;
  --blue: #48a8ff;
  --bg: #050505;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 70% -10%, rgba(72, 168, 255, .18), transparent 30rem),
    radial-gradient(circle at 95% 8%, rgba(240, 180, 91, .12), transparent 28rem),
    linear-gradient(135deg, #030303, #11100e);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.sidebar {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(5, 5, 5, .86);
}

.logo {
  width: min(100%, 280px);
  display: block;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .72));
}

h1, h2, p { margin-top: 0; }
h1 { font-size: 34px; text-transform: uppercase; line-height: .95; }
h2 { font-size: 20px; }
p { color: var(--muted); line-height: 1.45; }

.content { padding: 24px; min-width: 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

.login-panel { max-width: 460px; margin: 7vh auto; }

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

.project-grid, .user-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  background: rgba(255, 255, 255, .055);
  color: var(--ink);
  padding: 10px;
  outline: none;
}

textarea { min-height: 88px; resize: vertical; }
select option { background: #111; color: var(--ink); }

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(72, 168, 255, .18);
}

.primary, .ghost, .tabs button, .link-btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 13px;
  font-weight: 900;
}

.primary {
  background: linear-gradient(135deg, #f7d28d, #b77a32);
  color: #111;
}

.ghost, .tabs button {
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  border: 1px solid var(--line);
}

.tabs button.active {
  background: rgba(72, 168, 255, .14);
  color: #dbeeff;
  border-color: rgba(72, 168, 255, .48);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

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

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-page { display: none; gap: 16px; }
.tab-page.active { display: grid; }

.user-box {
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.project-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.project-card {
  display: grid;
  gap: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.project-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.status {
  border-radius: 999px;
  padding: 5px 9px;
  width: max-content;
  background: rgba(246, 198, 111, .16);
  color: #ffd992;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.stem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

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

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); text-transform: uppercase; font-size: 12px; }

.hint { min-height: 20px; color: #ffcf82; }
code { color: #dbeeff; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .project-grid, .user-grid { grid-template-columns: 1fr; }
  .stem-row { grid-template-columns: 1fr; }
}
