/* MMM Adminpanel - meant to be usable, not pretty. No inline styles anywhere (the CSP forbids them). */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --line: #d5d9e0; --text: #1c2330; --muted: #5d6778;
  --accent: #1f5fbf; --ok: #1d7a3e; --warn: #9a6200; --bad: #b3261e;
  --ok-bg: #e3f4e8; --warn-bg: #fff3d6; --bad-bg: #fde7e5; --info-bg: #e6eefb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 system-ui, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 20px 0 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
p { margin: 6px 0; }
a { color: var(--accent); }
code, pre, .mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; }
pre { background: #f0f2f5; border: 1px solid var(--line); padding: 8px; overflow: auto; max-height: 420px; white-space: pre-wrap; word-break: break-word; margin: 6px 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 1px solid #aab2c0; background: #fff; border-radius: 4px; padding: 5px 10px; cursor: pointer; }
button:hover { background: #eef1f6; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #184c99; }
button.danger { border-color: var(--bad); color: var(--bad); }
button.danger:hover { background: var(--bad-bg); }
button.small { padding: 2px 7px; font-size: 12.5px; }
button:disabled { opacity: .55; cursor: not-allowed; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=file], select, textarea {
  border: 1px solid #aab2c0; border-radius: 4px; padding: 5px 7px; background: #fff; max-width: 100%;
}
textarea { width: 100%; min-height: 70px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: #eceff3; }

.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 340px; max-width: 100%; }
.login label { display: block; margin: 10px 0; font-weight: 600; }
.login input { display: block; width: 100%; margin-top: 3px; font-weight: 400; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px; }

.app { height: 100%; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #1c2330; color: #fff; }
.top .brand { margin-right: auto; }
.top .who { color: #c9d2e3; margin-right: 6px; }
.top button { background: transparent; color: #fff; border-color: #56617a; }
.top button:hover { background: #2c364a; }
.body { flex: 1; display: flex; min-height: 0; }
.nav { width: 190px; background: var(--panel); border-right: 1px solid var(--line); padding: 8px 0; overflow: auto; flex: none; }
.nav a { display: block; padding: 7px 16px; color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.nav a:hover { background: #eef1f6; }
.nav a.current { border-left-color: var(--accent); background: var(--info-bg); font-weight: 600; }
.view { flex: 1; overflow: auto; padding: 16px 20px 60px; min-width: 0; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.toolbar label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.toolbar .grow { flex: 1; }
.count { color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0; }
.tabs button { border-radius: 4px 4px 0 0; border-bottom: none; background: #e9ecf1; }
.tabs button.current { background: var(--panel); font-weight: 600; border-color: var(--accent); }

.table-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 5px 9px; border-bottom: 1px solid #e6e9ee; vertical-align: top; }
th { background: #eef1f6; position: sticky; top: 0; white-space: nowrap; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f3f6fb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; }
td.actions button { margin-right: 4px; }
td.wrap { word-break: break-word; max-width: 460px; }
.empty { padding: 14px; color: var(--muted); }

.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; background: #e3e7ee; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--accent); }
.muted { color: var(--muted); }

.notice { padding: 8px 10px; border-radius: 4px; background: var(--info-bg); border: 1px solid #b9cdf0; margin: 8px 0; }
.notice.error { background: var(--bad-bg); border-color: #efb3ae; color: var(--bad); }
.notice.warn { background: var(--warn-bg); border-color: #ecd28f; color: var(--warn); }
.notice.ok { background: var(--ok-bg); border-color: #a9d9b8; color: var(--ok); }

.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; min-width: 150px; }
.tile .value { font-size: 22px; font-weight: 600; }
.tile .label { color: var(--muted); }

.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field.wide { grid-column: 1 / -1; }
.field > span.label { font-weight: 600; }
.field .hint { color: var(--muted); font-size: 12.5px; }
.field .problem { color: var(--bad); font-size: 12.5px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.field.check { flex-direction: row; align-items: center; gap: 7px; }
.weights { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.weights label { display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); }
.weights input { width: 100%; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.buttons .spacer { flex: 1; }

dialog { border: 1px solid var(--line); border-radius: 8px; padding: 0; width: min(880px, 96vw); max-height: 92vh; }
dialog.narrow { width: min(460px, 96vw); }
dialog::backdrop { background: rgba(20, 26, 38, .5); }
dialog .dlg-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 16px; }
dialog .dlg-body { padding: 14px 16px; overflow: auto; max-height: calc(92vh - 120px); }
dialog .dlg-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: 420px; }
.toast { padding: 9px 13px; border-radius: 5px; background: #1c2330; color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--bad); }

.split { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.split > .side { flex: none; }
.split > .main { flex: 1; min-width: 320px; }
img.card-art { width: 225px; height: 314px; object-fit: contain; background: #e9ecf1; border: 1px solid var(--line); border-radius: 6px; }
.mail-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.mail-group h2 { margin: 0; }
.bilingual { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.bilingual label { display: flex; flex-direction: column; gap: 2px; }
.bilingual .lang { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .bilingual { grid-template-columns: 1fr; } }
.image-pick {display: flex; flex-direction: column; gap: 4px; }
.image-pick-row { display: flex; align-items: center; gap: 8px; }
.image-pick-row select { flex: 1; min-width: 0; }
img.thumb.pick-preview { width: 64px; height: 64px; }
img.thumb {width: 44px; height: 44px; object-fit: contain; background: #e9ecf1; border: 1px solid var(--line); border-radius: 3px; display: block; }
p.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0; }
.crop-preview { margin: 8px 0 12px; }
.crop-preview canvas { display: block; max-width: 100%; max-height: 280px; width: auto; height: auto; background: #e9ecf1; border: 1px solid var(--line); border-radius: 3px; }
.image-pick .hint.warn { color: #a15c00; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.secret { font-size: 18px; padding: 10px; background: #f0f2f5; border: 1px dashed #8793a8; border-radius: 4px; user-select: all; text-align: center; }
.back { display: inline-block; margin-bottom: 6px; }
.rule-key { color: var(--muted); font-size: 11.5px; }
.seat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin: 12px 0; }
.seat-card h3 { margin-top: 0; }
.deck-list { font-size: 13px; margin: 6px 0; }
.match-log .toolbar h3 { margin: 0; }
.match-log .turn { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; margin: 8px 0; }
.match-log .turn h4 { margin: 4px 0; font-size: 13.5px; }
.match-log .turn ol { margin: 0; padding-left: 20px; list-style: none; }
.match-log .turn li { padding: 1px 0; }

@media (max-width: 760px) {
  .body { flex-direction: column; }
  .nav { width: auto; display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 0; }
  .nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .nav a.current { border-bottom-color: var(--accent); }
}

/* Texte: the translation list */
.wide-search { min-width: 280px; }
a.button-link { display: inline-block; border: 1px solid #aab2c0; background: #fff; border-radius: 4px; padding: 5px 10px; color: var(--text); text-decoration: none; }
a.button-link:hover { background: #eef1f6; }
table.texts td.text-key { width: 240px; min-width: 200px; word-break: break-word; }
table.texts td.text-key .mono { font-weight: 600; }
table.texts td.text-key > div { margin-bottom: 3px; }
table.texts td.text-cell { min-width: 260px; }
table.texts td.text-cell textarea { min-height: 52px; }
table.texts td.missing textarea { background: var(--warn-bg); }
table.texts td.saving textarea { opacity: .6; }
table.texts td.invalid textarea { border-color: var(--bad); }
.cell-info .problem { color: var(--bad); font-size: 12.5px; }
.cell-info .warn-text { color: var(--warn); font-size: 12.5px; }
.small { font-size: 12.5px; }

/* Which installation: the test system is orange from top to bottom of the head, the live system carries a red badge. */
.env { display: inline-block; padding: 2px 10px; border-radius: 4px; font-weight: 700; letter-spacing: .06em; font-size: 13px; }
.env.test { background: #ffb300; color: #1c2330; }
.env.prod { background: #b3261e; color: #fff; }
.top .env { margin-right: auto; }
.top .brand { margin-right: 4px; }
body.env-test .top { background: #7a4a00; border-bottom: 4px solid #ffb300; }
body.env-test .top button { border-color: #c89a4a; }
body.env-test .top button:hover { background: #8f5a08; }
.login .env { display: block; text-align: center; margin: 0 0 10px; padding: 6px 10px; }

/* Transports */
.toast.offer { display: flex; align-items: center; gap: 10px; }
.toast.offer button { background: #fff; color: var(--text); border-color: #fff; white-space: nowrap; }
.tr-item { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 10px 12px; margin: 10px 0; }
.tr-item.problem { border-color: var(--bad); }
.tr-item.conflict { border-color: #d49a00; }
.tr-item h4 { margin: 0 0 6px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tr-item table { width: 100%; border-collapse: collapse; margin: 4px 0; }
.tr-item th, .tr-item td { text-align: left; vertical-align: top; padding: 3px 8px 3px 0; border-top: 1px solid #eceff3; overflow-wrap: anywhere; }
.tr-item th { width: 22%; font-weight: 600; }
.tr-item td.before { width: 39%; color: var(--muted); }
.tr-item td.after { width: 39%; }
.tr-item ul { margin: 2px 0 2px 18px; padding: 0; }
.tr-item .added { color: var(--ok); }
.tr-item .removed { color: var(--bad); }
.tr-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
