*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --page:            #0d0d0d;
  --surface:         #1a1a19;
  --text-primary:    #ffffff;
  --text-secondary:  #c3c2b7;
  --text-muted:      #898781;
  --border:          rgba(255,255,255,0.10);
  --series-1:        #3987e5;
  --status-good:     #0ca30c;
  --status-warning:  #d0a23b;
  --status-critical: #d03b3b;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--text-secondary); }
a:hover { color: var(--text-primary); }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.app-name { font-weight: 600; letter-spacing: 0.02em; color: var(--text-primary); text-decoration: none; }
.logout-link { color: var(--text-muted); text-decoration: none; font-size: 13px; }
.logout-link:hover { color: var(--text-primary); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.9rem; font-weight: 500; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.card-header h2 { margin-bottom: 0; }

/* forms */
input, button {
  font-family: inherit;
  font-size: 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.5rem 0.65rem;
}
input:focus { outline: none; border-color: rgba(57,135,229,0.5); }
button {
  background: rgba(57,135,229,0.16);
  border-color: rgba(57,135,229,0.35);
  cursor: pointer;
  font-weight: 500;
}
button:hover { background: rgba(57,135,229,0.28); }

/* modules */
.module {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.module:last-child { border-bottom: none; }
.module-info { display: flex; flex-direction: column; }
.module-name { font-weight: 600; }
.module-desc { color: var(--text-muted); font-size: 12px; }
.module-params { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.module-params input { width: 280px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
th { color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
table.meta th { width: 90px; }
td.params { font-family: ui-monospace, monospace; font-size: 12px; color: var(--text-secondary); word-break: break-all; }
.empty { color: var(--text-muted); text-align: center; padding: 1.5rem 0; }
code { font-family: ui-monospace, monospace; background: rgba(255,255,255,0.06); padding: 0.1rem 0.3rem; border-radius: 3px; }

.status { font-size: 12px; font-weight: 500; }
.status-queued  { color: var(--text-muted); }
.status-running { color: var(--status-warning); }
.status-done    { color: var(--status-good); }
.status-failed  { color: var(--status-critical); }

pre.output {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 70vh;
  overflow: auto;
  color: var(--text-secondary);
}
pre.output.error { color: var(--status-critical); }

.flash {
  background: rgba(208,59,59,0.12);
  border-bottom: 1px solid rgba(208,59,59,0.3);
  color: var(--text-primary);
  padding: 0.6rem 1.5rem;
  font-size: 13px;
  text-align: center;
}

/* auth */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-box form { display: flex; flex-direction: column; gap: 0.75rem; width: 260px; }
.auth-appname { display: block; text-align: center; font-weight: 600; margin-bottom: 1.25rem; letter-spacing: 0.02em; }
