:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #e2e5ea;
  --text: #1c1f26;
  --text-muted: #6b7280;
  --accent: #2f6fed;
  --ok: #15803d;
  --bad: #b91c1c;
  --warn: #a15c00;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 52px; width: auto; display: block; }
.brand-sep { color: var(--text-muted); }
.top-right { display: flex; align-items: center; gap: 12px; color: var(--text-muted); }
.lang button { font: inherit; font-size: 12px; font-weight: 700; padding: 2px 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); border-radius: 999px; cursor: pointer; margin-left: 4px; }
.lang button.active { border-color: var(--accent); color: var(--accent); }

main { max-width: 1280px; margin: 0 auto; padding: 16px 24px 48px; display: flex; flex-direction: column; gap: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { font: inherit; padding: 10px 14px; border: none; background: none; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.panel { display: flex; flex-direction: column; gap: 14px; }
.hint { margin: 0; color: var(--text-muted); max-width: 90ch; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.card h3 { margin: 0; font-size: 15px; grid-column: 1 / -1; }
.narrow { max-width: 380px; margin: 60px auto; display: flex; flex-direction: column; gap: 12px; }
.narrow form { display: flex; flex-direction: column; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; align-items: end; }
.grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.mods { border: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 12px; width: 100%; }

button.primary { font: inherit; padding: 7px 14px; border-radius: 6px; border: none; background: var(--accent); color: #fff; cursor: pointer; }
button.small, a.small { font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
button.link { font: inherit; background: none; border: none; color: var(--accent); cursor: pointer; padding: 0 4px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

.table-tools { display: flex; justify-content: flex-end; margin-bottom: -6px; }

/* Header filters (tableFilters.js, as in the e-workflow app). */
thead tr.tf-row th { padding-top: 2px; padding-bottom: 6px; vertical-align: top; }
.tf-input { width: 100%; min-width: 0; box-sizing: border-box; padding: 3px 6px; font: inherit; font-size: 12px; font-weight: normal; text-transform: none; letter-spacing: normal; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); }
.tf-input[list]::-webkit-calendar-picker-indicator { opacity: 1; display: block; cursor: pointer; }
tbody tr.tf-hidden { display: none; }
tbody tr.tf-none td { color: var(--text-muted); text-align: center; padding: 12px; }
td.actions { white-space: nowrap; display: flex; flex-wrap: wrap; gap: 4px; }
.muted { color: var(--text-muted); font-size: 12px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: var(--surface-2); color: var(--text-muted); }
.pill.ok { background: rgba(21, 128, 61, 0.12); color: var(--ok); }
.pill.bad { background: rgba(185, 28, 28, 0.12); color: var(--bad); }
.pill.warn { background: rgba(217, 119, 6, 0.14); color: var(--warn); }
.over { color: var(--bad); font-weight: 600; }

.error { background: rgba(185, 28, 28, 0.08); border: 1px solid rgba(185, 28, 28, 0.3); color: var(--bad); border-radius: 8px; padding: 8px 12px; }
.notice { background: rgba(21, 128, 61, 0.08); border: 1px solid rgba(21, 128, 61, 0.3); border-radius: 8px; padding: 8px 12px; }
.notice.secret code { font-size: 13px; }
.sign-box { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; min-width: 320px; }

@media (max-width: 640px) {
  .top, main { padding-left: 16px; padding-right: 16px; }
}
button.small:disabled { opacity: .45; cursor: not-allowed; }
