/* Dark tool palette (LSSR / AutoCode / ArguMap). This is not the borant.eu
   corporate identity: that one is the face the company shows outward, this is
   the face the tools show to the people working inside them.

   In grids always minmax(0, 1fr) and never a bare 1fr: the implicit minimum of
   1fr is auto, i.e. the content's minimum width, and a column that cannot
   shrink below its own content pushes the page sideways instead of letting the
   tables scroll inside their .table-wrap. It only shows up in the longest
   language on the narrowest screen — here, German. */

:root {
  --bg: #0f1117;
  --card: #1a1d27;
  --border: #2d3148;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --primary: #0a3c8a;
  --accent: #63b3ed;
  --green: #2f855a;
  --red: #9b2c2c;
  /* Legible as text on the dark background; --red is for fills. */
  --red-bright: #fc8181;
  --amber: #975a16;
  --radius-card: 10px;
  --radius-control: 6px;
  --topbar: 56px;
  --container: 980px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ topbar */

/* min-height, not height: with six nav items and a long language the bar's
   content does not fit in 56px, and a fixed height does not contain it — it
   lets it spill *over* the page. Visible only in German and only when narrow. */
.topbar {
  min-height: var(--topbar);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 8px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand { font-weight: 600; letter-spacing: .3px; color: var(--text); }
.topbar .brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; min-width: 0; }
.topbar nav a { color: var(--text-dim); font-size: 14px; }
.topbar nav a:hover, .topbar nav a.active { color: var(--accent); }
.topbar .push { margin-left: auto; }

.languages { display: flex; gap: 6px; align-items: center; }
.languages a {
  color: var(--text-dim); font-size: 12px; text-transform: uppercase;
  padding: 3px 6px; border-radius: 4px; letter-spacing: .5px;
}
.languages a.active { background: var(--primary); color: #fff; }

/* --------------------------------------------------------------- container */

.container { max-width: var(--container); margin: 0 auto; padding: 26px 20px 60px; }

h1 { font-size: 26px; margin: 0 0 6px; font-weight: 600; }
h2 { font-size: 18px; margin: 26px 0 12px; font-weight: 600; }
.subtitle { color: var(--text-dim); margin: 0 0 24px; }

/* -------------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 14px;
}

.card-module { display: block; color: inherit; }
.card-module:hover { border-color: var(--accent); text-decoration: none; }
.card-module .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--accent); letter-spacing: 1px;
}
.card-module .name { margin-top: 4px; font-weight: 500; }

/* ----------------------------------------------------------------- controls */

label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }

input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 9px 11px;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}

.field { margin-bottom: 14px; }
.help { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

.btn {
  display: inline-block;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 9px 16px;
  font: inherit;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.18); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--accent); padding: 0; }

/* ------------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.table th { color: var(--text-dim); font-weight: 500; font-size: 13px; }
.table tbody tr:hover { background: rgba(99, 179, 237, .05); }

/* --------------------------------------------------------- badges and flash */

.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim); white-space: nowrap;
}
.badge-ok { background: var(--green); border-color: var(--green); color: #fff; }
.badge-pending { background: var(--amber); border-color: var(--amber); color: #fff; }

.flash {
  border-radius: var(--radius-control); padding: 11px 14px; margin-bottom: 16px;
  border: 1px solid var(--border); font-size: 14px;
}
.flash-error { background: rgba(155, 44, 44, .18); border-color: var(--red); }

/* ----------------------------------------------------------------- showcase */

.showcase { max-width: 620px; margin: 12vh auto 0; padding: 0 20px; text-align: center; }
.showcase h1 { font-size: 40px; letter-spacing: -.5px; }
.showcase .eyebrow { color: var(--accent); font-size: 15px; margin-bottom: 22px; }
.showcase p { color: var(--text-dim); margin-bottom: 30px; }

.signin { max-width: 400px; margin: 9vh auto 0; padding: 0 20px; }

.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-control); padding: 12px;
  word-break: break-all; font-size: 14px; letter-spacing: 1px;
}

.footer {
  border-top: 1px solid var(--border); margin-top: 40px; padding-top: 16px;
  color: var(--text-dim); font-size: 12px;
}

@media (max-width: 640px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .topbar { gap: 8px 12px; padding: 8px 12px; }
  /* The nav takes a row of its own and scrolls inside it: wrapping six items
     would eat half a screen of height on every page. */
  .topbar nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 14px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .topbar nav a { white-space: nowrap; }
  .topbar .push { margin-left: auto; }
}

/* ---------------------------------------------------------------- form pages */

.container.narrow { max-width: 620px; }

.page-head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 { margin-bottom: 4px; }
.page-head .subtitle { margin-bottom: 0; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent); letter-spacing: 1px;
}

/* The four languages in a 2x2 block, as in the desktop app: proofreading a
   translation means comparing it with the others, and a fixed two-column pairing
   (EN|DE over FR|IT) keeps a given language in the same place on every field
   group. auto-fit would reflow to 3+1 at some widths and move them around.

   minmax(0, 1fr) and not a bare 1fr: the implicit minimum of 1fr is the
   content's own width, so a long German compound would stop the textarea from
   shrinking and push the page sideways. */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
@media (max-width: 760px) {
  .lang-grid { grid-template-columns: minmax(0, 1fr); }
}
.lang-grid textarea { resize: vertical; min-height: 120px; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 8px 16px;
}

.check {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text); margin-bottom: 0;
}
.check input { width: auto; }

.flags { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 4px; }

.field-narrow { max-width: 160px; }
.req { color: var(--accent); }

.form-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 20px;
}
.form-actions form { margin: 0; }

.flash-ok { background: rgba(47, 133, 90, .18); border-color: var(--green); }

.table td.num { text-align: right; font-variant-numeric: tabular-nums; width: 6em; }

/* ------------------------------------------------------------------- photos */

.avatar-cell { width: 52px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  display: block; background: var(--bg); border: 1px solid var(--border);
}
.avatar-empty { border-style: dashed; }

.photo-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.photo-controls { flex: 1 1 260px; min-width: 0; }

.photo-preview {
  width: 140px; height: 140px; object-fit: cover; flex: none;
  border-radius: var(--radius-card);
  background: var(--bg); border: 1px solid var(--border);
}
.photo-empty {
  display: flex; align-items: center; justify-content: center;
  border-style: dashed; color: var(--text-dim); font-size: 12px; text-align: center;
}

input[type=file] {
  width: 100%; font: inherit; color: var(--text-dim);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-control); padding: 8px 10px;
}
input[type=file]::file-selector-button {
  font: inherit; margin-right: 10px; cursor: pointer;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-control);
  padding: 5px 12px;
}

/* ------------------------------------------------------- filter bar & rows */

.filter-bar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; }
.filter-bar label { margin: 0; white-space: nowrap; }
.filter-bar select { width: auto; min-width: 160px; }

/* Fields side by side that collapse in one go. auto-fit with a floor rather
   than fixed columns: three short fields on one row read better than three
   rows, but a long German label must be allowed to take the width it needs. */
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 0 18px;
}

.flash-warn { background: rgba(151, 90, 22, .2); border-color: var(--amber); }

/* ------------------------------------------------------------- the rename fork */

.rename-diff {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-control); padding: 16px; margin: 18px 0;
}
.rename-side { flex: 1 1 200px; min-width: 0; }
.rename-label { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.rename-name { font-weight: 500; word-break: break-word; }
.rename-arrow { color: var(--accent); font-size: 20px; flex: none; }

/* Two options of equal weight. This is a question, not a confirmation with a
   safe default: making one look like the way out would answer it for the user. */
.choice-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 14px; margin: 20px 0;
}
.choice-grid form { margin: 0; display: flex; }
.choice {
  display: flex; flex-direction: column; gap: 10px; width: 100%;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 18px;
}
.choice h2 { margin: 0; font-size: 16px; }
.choice p { margin: 0; color: var(--text-dim); font-size: 14px; flex: 1; }

/* --------------------------------------------------------- experience form */

.container.wide { max-width: 1180px; }

.readonly-value {
  background: var(--bg); border: 1px dashed var(--border);
  border-radius: var(--radius-control); padding: 9px 11px;
  color: var(--text-dim); overflow-wrap: anywhere;
}
.mono-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
}
.cuts-field { grid-column: span 2; }
@media (max-width: 700px) { .cuts-field { grid-column: auto; } }

/* Long taxonomy names must not stretch the table past the viewport; the cell
   truncates and the whole table still scrolls inside its .table-wrap. */
.table td.truncate { max-width: 260px; overflow: hidden;
                     text-overflow: ellipsis; white-space: nowrap; }

.filter-bar input[type=text] { width: auto; min-width: 200px; flex: 1 1 200px; }

/* A row the editors have marked as wrong. Red across the whole row and not
   only on a badge, because the point is to be seen while scanning 968 of them,
   and a left border carries it when a wash of colour does not. */
.row-needs-check > td { background: rgba(155, 44, 44, .22); }
.row-needs-check > td:first-child { box-shadow: inset 3px 0 0 var(--red-bright); }

/* Solid fill and white text, like .badge-pending. On this dark palette red text
   on a red wash is two dark colours on top of each other: --red is #9b2c2c and
   the card is #1a1d27, which lands around 1.9:1 and cannot be read. */
.pill {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.pill-danger { background: var(--red); color: #fff; }
/* White on --green is around 4.7:1, which reads. The same caution as above
   applies: the dark green is a fill, never text on the card. */
.pill-ok { background: var(--green); color: #fff; }
/* A line hung under the row it is about, for a state that stops an account
   working. Indented so it reads as a note and not as another account. */
.row-note > td { padding-top: 0; border-top: 0; padding-left: 1.6rem; }

/* For red *text* on the dark background, the dark red is unreadable too, so
   sentences use the bright one. */
.hint-danger { color: var(--red-bright); font-size: 13px; }

/* The two ways out of an experience: the published page and the CMS entry.
   Spaced away from the flags above them, because they leave the application
   and the flags do not. */
.links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }

/* The queue's three sections. Spaced apart because they are three different
   questions, not three filters on one list. */
h2.section { margin: 2rem 0 .25rem; font-size: 1.05rem; }
h2.section .count {
  display: inline-block; margin-left: .5rem; padding: .05rem .5rem;
  border-radius: 999px; background: var(--border); color: var(--text-dim);
  font-size: .75rem; font-weight: 600; vertical-align: middle;
}
