/* Burgstall Labs portal — small hand-written stylesheet, no framework. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5d6b7a;
  --line: #dde2e8;
  --brand: #1f3a5f;
  --brand-2: #2f6fb0;
  --ok: #1d7a4a;
  --warn: #9a6400;
  --bad: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161d;
    --surface: #18202a;
    --text: #e6ebf1;
    --muted: #9aa8b7;
    --line: #2a3542;
    --brand: #8db7e8;
    --brand-2: #6aa4e6;
    --ok: #5cc98d;
    --warn: #e0b153;
    --bad: #f08a82;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.25; margin: 1.2em 0 0.5em; }
h1 { font-size: 1.6rem; margin-top: 0.4em; }
h2 { font-size: 1.25rem; }
h3, .h3 { font-size: 1.05rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--mono); }
.break { word-break: break-all; }
.num { text-align: right; white-space: nowrap; }

.env-banner { background: var(--warn); color: #fff; text-align: center; font-size: 0.85rem; padding: 2px 8px; }
.topbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); display: inline-block; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
.nav a { text-decoration: none; color: var(--text); }
.nav a:hover { color: var(--brand-2); }
form.inline { display: inline; margin: 0; }
.lang .active { font-weight: 700; text-decoration: underline; }

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.25rem; flex: 1; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding: 1rem 1.25rem; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.crumbs { font-size: 0.875rem; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin: 1rem 0; }
.card > h1:first-child, .card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.narrow { max-width: 560px; }
.note { border-left: 4px solid var(--brand-2); }
.auth-page { display: flex; flex-direction: column; align-items: center; }
.auth-page > * { width: 100%; max-width: 460px; }
.auth-page .messages { max-width: 460px; }
.auth-page > form, .auth-page > p, .auth-page > h1 { max-width: 460px; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.tiles { list-style: none; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tile a { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); height: 100%; }
.tile a:hover { border-color: var(--brand-2); }
.tile-title { font-weight: 600; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.msg { padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 0.5rem; }
.msg-success { border-left: 4px solid var(--ok); }
.msg-error { border-left: 4px solid var(--bad); }
.msg-warning { border-left: 4px solid var(--warn); }
.msg-info { border-left: 4px solid var(--brand-2); }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.badge-complete, .badge-active { color: var(--ok); border-color: currentColor; }
.badge-uploading, .badge-delivered { color: var(--brand-2); border-color: currentColor; }
.badge-failed, .badge-expired, .badge-deleted { color: var(--bad); border-color: currentColor; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }

label { font-weight: 600; display: block; margin-bottom: 0.25rem; }
label.check { font-weight: 400; display: flex; gap: 0.5rem; align-items: flex-start; }
.field { margin-bottom: 0.9rem; }
.field ul { list-style: none; padding: 0; margin: 0; max-height: 18rem; overflow: auto; }
.field ul label { font-weight: 400; display: flex; gap: 0.5rem; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
input[type=text], input[type=email], input[type=datetime-local], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text);
}
textarea { min-height: 6rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.error { color: var(--bad); display: block; }
.errors { color: var(--bad); }
.has-error input { border-color: var(--bad); }

.btn, button.btn {
  display: inline-block; padding: 0.55rem 1rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { border-color: var(--brand-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0d1620; } }
.btn.small { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
button.link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer; }
button.link:hover { color: var(--brand-2); }
pre.cmd { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

.dropzone { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center; font-weight: 400; cursor: pointer; color: var(--muted); }
.dropzone.is-over { border-color: var(--brand-2); background: rgba(47, 111, 176, 0.06); }
.dropzone input { display: block; margin: 0 auto 0.75rem; max-width: 100%; }
.upload-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.upload-item { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.upload-item progress { grid-column: 1 / -1; width: 100%; height: 0.6rem; accent-color: var(--brand-2); }
.upload-item .upload-name { font-weight: 600; word-break: break-all; }
.upload-item .upload-status { grid-column: 1 / -1; }
.upload-item .btn { grid-row: 1; grid-column: 2; }
.upload-item.is-done .upload-status { color: var(--ok); }
.upload-item.is-failed .upload-status { color: var(--bad); }

@media (max-width: 600px) {
  .container { padding: 1rem; }
  th, td { padding: 0.5rem; }
  h1 { font-size: 1.35rem; }
}
