/* Design tokens transcribed from Strategiepapier VII (Teil A/B/C).
   This is the dashboard's own UI, not an article page, so only the tokens
   that apply to app chrome are used here — no header/article compositions
   (those are Block 5, the SVG shape library). */

:root {
  --color-primary: #2952e3;
  --color-mist-blue: #dce6fb;
  --color-apricot: #fbe0d0;
  --color-sage: #dcefe3;
  --color-lilac: #e8e1f7;
  --color-graphite: #1b1f2a;
  --color-paper: #f7f8fc;

  --color-dept-economy: #e8935e;
  --color-dept-psyche: #5ea37e;
  --color-dept-power: #2952e3;
  --color-dept-science: #8c6fd1;

  --font-display: "Space Grotesk", "General Sans", system-ui, sans-serif;
  --font-body: "Inter", "IBM Plex Sans", system-ui, sans-serif;

  --radius-pill: 999px;
  --radius-lg: 28px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --glass-blur: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--color-paper);
  color: var(--color-graphite);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
}

/* --- Glass nav bar (Teil C.2: glass is an accent for floating UI, not a
   general texture) --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  padding-top: calc(14px + env(safe-area-inset-top, 0));
  background: rgba(247, 248, 252, 0.72);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid rgba(27, 31, 42, 0.06);
}

.topbar .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.topbar .brand .accent {
  color: var(--color-graphite);
  font-weight: 500;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

/* --- Queue list --- */
.queue-item {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(27, 31, 42, 0.06);
  cursor: pointer;
}

.queue-item .gate-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}

.gate-tag.gate_1_topic { background: var(--color-mist-blue); color: var(--color-primary); }
.gate-tag.gate_2_research { background: var(--color-lilac); color: #8c6fd1; }
.gate-tag.gate_3_publication { background: var(--color-sage); color: #5ea37e; }

.queue-item .summary {
  font-size: 15px;
  line-height: 1.45;
}

.queue-item .meta {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(27, 31, 42, 0.55);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(27, 31, 42, 0.5);
  font-size: 15px;
}

/* --- Detail sheet --- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 31, 42, 0.35);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0));
  z-index: 21;
}

.sheet h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.sheet .field-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(27, 31, 42, 0.5);
  margin-top: 16px;
  margin-bottom: 4px;
}

.sheet .body-text {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.6;
}

.sheet pre.json {
  background: var(--color-paper);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 12px;
  overflow-x: auto;
}

.sheet .error-message {
  background: var(--color-apricot);
  color: var(--color-graphite);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 14px;
}

/* --- Buttons --- */
.actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  cursor: pointer;
}

button.approve { background: var(--color-primary); color: #fff; }
button.reject { background: #fff; color: var(--color-graphite); border: 1px solid rgba(27,31,42,0.15); }
button.change { background: var(--color-apricot); color: #8a4a1f; }
button.close { background: transparent; color: rgba(27,31,42,0.5); }
button:disabled { background: rgba(27,31,42,0.08); color: rgba(27,31,42,0.35); cursor: not-allowed; }

/* --- Login --- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 30px rgba(27, 31, 42, 0.1);
}

.login-card h1 {
  font-size: 24px;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.login-card p {
  font-size: 13px;
  color: rgba(27, 31, 42, 0.55);
  margin: 0 0 20px;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(27, 31, 42, 0.15);
  font-size: 15px;
  margin-bottom: 12px;
}

.login-card button {
  width: 100%;
  background: var(--color-primary);
  color: #fff;
  padding: 13px;
}

.login-error {
  color: #c0392b;
  font-size: 13px;
  margin-bottom: 10px;
}

/* --- Jobs section --- */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 10px;
}

.section-heading h2 {
  font-size: 15px;
  color: rgba(27, 31, 42, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cost-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.cost-card .cost-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.cost-card .cost-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}

.cost-card .cost-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(27, 31, 42, 0.08);
  overflow: hidden;
  margin: 8px 0;
}

.cost-card .cost-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
}

.cost-card .cost-bar-fill.over-budget {
  background: #c0392b;
}

.cost-card .cost-label {
  font-size: 12px;
  color: rgba(27, 31, 42, 0.55);
}

.job-item {
  background: #fff;
  border-left: 3px solid #c0392b;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}

.job-item .job-type {
  font-weight: 600;
}

.job-item .job-error {
  color: rgba(27, 31, 42, 0.6);
  margin-top: 2px;
}

.tabs {
  display: flex;
  gap: 4px;
  background: rgba(27, 31, 42, 0.06);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 16px;
}

.tabs button {
  flex: 1;
  background: transparent;
  color: rgba(27, 31, 42, 0.6);
  padding: 8px;
}

.tabs button.active {
  background: #fff;
  color: var(--color-graphite);
  box-shadow: 0 1px 3px rgba(27,31,42,0.1);
}
