/* Twinrope back-office. Direction "Console" of the brand: dark petrol rail, light grey page, white cards, blue actions. */

@font-face { font-family: "Noto Sans"; src: url("/_app/fonts/noto-sans.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans"; src: url("/_app/fonts/noto-sans-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Noto Sans Mono"; src: url("/_app/fonts/noto-sans-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans Mono"; src: url("/_app/fonts/noto-sans-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font: 400 13px/20px var(--font-sans); color: var(--ink); background: var(--surface-1);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Frame ---------- */
.env-rule { position: fixed; inset: 0 0 auto 0; height: var(--env-rule); background: var(--brand); z-index: 10; }
.shell { display: grid; grid-template-columns: var(--rail-width) 1fr; min-height: 100vh; }

.rail { background: var(--nav-bg); color: var(--nav-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding-top: var(--env-rule); }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.rail-brand img { width: 30px; height: 30px; }
.rail-brand small { display: block; font-size: 11px; font-weight: 500; color: var(--nav-ink-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 1px; }
.rail-eyebrow { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nav-ink-muted); padding: 16px 18px 6px; }
.rail-item { display: flex; align-items: center; gap: 12px; height: var(--nav-item); padding: 0 18px; color: var(--nav-ink); font-size: 14px; position: relative; }
.rail-item:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.rail-item[aria-current="page"] { background: var(--nav-active); color: var(--nav-active-ink); font-weight: 600; }
.rail-item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--nav-mark); }
.rail-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.rail-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--nav-mark); color: #0d1117; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.rail-count.warn { background: #e3b341; }
.rail-foot { margin-top: auto; border-top: 1px solid var(--nav-line); padding: 12px 18px 16px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--nav-active); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.rail-foot .who { font-size: 12px; line-height: 16px; color: var(--nav-ink); }
.rail-foot .who span { color: var(--nav-ink-muted); display: block; }
.rail-foot form { margin-left: auto; }
.rail-foot button { background: none; border: 1px solid var(--nav-line); color: var(--nav-ink); border-radius: var(--radius-sm); height: 28px; padding: 0 10px; font: inherit; font-size: 12px; cursor: pointer; }
.rail-foot button:hover { background: var(--nav-hover); color: #fff; }

.main { min-width: 0; padding-top: var(--env-rule); display: flex; flex-direction: column; }
.page-head { background: var(--header-bg); border-bottom: 1px solid var(--line); padding: 22px 28px 18px; display: flex; align-items: flex-start; gap: 16px; }
.page-head h1 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--ink-muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.crumbs { font-size: 12px; color: var(--ink-subtle); margin-bottom: 4px; }
.crumbs a { color: var(--ink-subtle); }
.content { padding: 20px 28px 40px; display: grid; gap: 20px; }

/* ---------- Cards and grids ---------- */
.card { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { font-size: 14px; line-height: 20px; font-weight: 600; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 16px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--line-soft); color: var(--ink-subtle); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1200px) { .grid-main-side { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; display: grid; gap: 2px; color: inherit; }
a.kpi:hover { border-color: var(--line-strong); text-decoration: none; }
.kpi .label { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle); }
.kpi .value { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--ink-muted); }
.kpi.attention { border-color: #f0c36d; background: linear-gradient(0deg, var(--warning-tint), var(--surface-0) 70%); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-subtle);
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-0); position: sticky; top: 0; }
table.data td { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; height: var(--row); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--row-selected); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .strong { font-weight: 600; }
table.data a.row-link { color: var(--ink); font-weight: 600; }
.muted { color: var(--ink-subtle); }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-subtle); }
.empty strong { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-muted); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.success { background: var(--success-tint); color: var(--success); }
.chip.warning { background: var(--warning-tint); color: var(--warning); }
.chip.danger { background: var(--danger-tint); color: var(--danger); }
.chip.info { background: var(--accent-tint); color: var(--accent); }
.chip.brand { background: #e5edf8; color: var(--brand); }
.chip.qual { background: var(--qual-tint); color: var(--qual); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-height); padding: 0 14px; border-radius: var(--radius-md);
  border: 1px solid var(--line-strong); background: var(--surface-0); color: var(--ink); font: 600 13px/1 var(--font-sans); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-1); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.outline { border-color: var(--accent); color: var(--accent); }
.btn.danger-outline { border-color: var(--danger); color: var(--danger); }
.btn.danger-outline:hover { background: var(--danger-tint); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.small { height: 26px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn svg { width: 16px; height: 16px; }
.inline-form { display: inline; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field > .label { font-weight: 600; font-size: 13px; }
.field .help { font-size: 12px; color: var(--ink-subtle); }
.field .error, .field-validation-error { font-size: 12px; color: var(--danger); font-weight: 600; }
.field .error:empty { display: none; }
.field .hint { font-size: 12px; color: var(--ink-muted); }
fieldset.env { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; margin: 0; min-width: 0; }
fieldset.env legend { padding: 0 6px; font-weight: 700; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%; height: var(--control-height-lg); padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-0);
  font: 400 13px/20px var(--font-sans); color: var(--ink); }
textarea { height: auto; min-height: 96px; padding: 8px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
input.mono { font-family: var(--font-mono); }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=search] { width: 320px; height: var(--control-height); }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.segmented a { padding: 4px 12px; border-radius: 6px; color: var(--ink-muted); font-weight: 600; font-size: 13px; display: inline-flex; gap: 8px; align-items: center; }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented a[aria-current="true"] { background: var(--surface-0); color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.segmented .count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-subtle); }

/* ---------- Definition lists ---------- */
dl.props { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; }
dl.props dt { color: var(--ink-subtle); }
dl.props dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Notices ---------- */
.notice { border-radius: var(--radius-md); padding: 12px 14px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.notice.success { background: var(--success-tint); border-color: #b7dfc2; color: #0f5222; }
.notice.warning { background: var(--warning-tint); border-color: #f0d48a; color: #5c3c00; }
.notice.danger { background: var(--danger-tint); border-color: #f3b7b7; }
.notice.info { background: var(--accent-tint); border-color: #bcd5f6; }
.secret { font-family: var(--font-mono); font-size: 13px; background: var(--surface-1); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); padding: 10px 12px; overflow-wrap: anywhere; user-select: all; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); display: grid; gap: 2px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .meta { font-size: 12px; color: var(--ink-subtle); display: flex; gap: 8px; align-items: center; }
.timeline .body { white-space: pre-wrap; color: var(--ink-muted); }

/* ---------- Sparkline ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.bars span { flex: 1; background: var(--accent); opacity: .85; border-radius: 2px 2px 0 0; min-height: 2px; }
.bars span:hover { opacity: 1; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(1200px 600px at 10% -10%, rgba(63,127,208,.22), transparent 60%), var(--nav-bg); padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface-0); border-radius: 16px; padding: 32px; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
.login-card .logo { height: 32px; margin-bottom: 24px; }
.login-card h1 { font-size: 20px; line-height: 28px; font-weight: 600; margin-bottom: 4px; }
.login-card p.lead { margin: 0 0 20px; color: var(--ink-muted); }
.login-card .btn.primary { width: 100%; height: 40px; }
.qr { display: grid; place-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); margin: 8px 0 12px; }
.qr svg { width: 200px; height: 200px; }
.otp { letter-spacing: .4em; font-family: var(--font-mono) !important; font-size: 18px !important; text-align: center; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  .rail-foot { margin-top: 0; }
}

/* Layout helpers. The Content-Security-Policy forbids style="" attributes, so pages use these classes instead.
   !important gives them the precedence the inline styles had. */
.u-mt4 { margin-top: 4px !important; }
.u-mt8 { margin-top: 8px !important; }
.u-mt16 { margin-top: 16px !important; }
.u-mb16 { margin-bottom: 16px !important; }
.u-ml6 { margin-left: 6px !important; }
.u-stack8, .u-stack12, .u-stack16, .u-stack20 { display: grid !important; }
.u-stack8 { gap: 8px !important; }
.u-stack12 { gap: 12px !important; }
.u-stack16 { gap: 16px !important; }
.u-stack20 { gap: 20px !important; }
.u-row8, .u-row10, .u-row12 { display: flex !important; }
.u-row8 { gap: 8px !important; }
.u-row10 { gap: 10px !important; }
.u-row12 { gap: 12px !important; }
.u-center { align-items: center !important; }
.u-baseline { align-items: baseline !important; }
.u-wrap { flex-wrap: wrap !important; }
.u-push-row { margin-left: auto !important; display: flex !important; gap: 6px !important; }
.u-between { display: flex !important; justify-content: space-between !important; }
.u-grow { flex: 1 !important; }
.u-cols2 { grid-template-columns: 1fr 1fr !important; gap: 16px !important; }
.u-span2 { grid-column: span 2 !important; }
.u-divider { border-bottom: 1px solid var(--line-soft) !important; }
.u-w520 { max-width: 520px !important; }
.u-w820 { max-width: 820px !important; }
.u-w900 { max-width: 900px !important; }
.u-label { font-weight: 600 !important; margin-bottom: 6px !important; }
.u-pre { white-space: pre-wrap !important; }
.u-small { font-size: 12px !important; }
.u-xsmall { font-size: 11px !important; }
.u-danger { color: var(--danger) !important; }
.u-nodeco { text-decoration: none !important; }
.u-mail-body { white-space: pre-wrap !important; font-family: var(--font-mono) !important; font-size: 12px !important; margin-top: 6px !important; }
.cols-interaction { grid-template-columns: 180px 1fr 200px !important; }
.cols-release { grid-template-columns: 140px 220px 200px 1fr auto !important; align-items: end !important; }
.props-compact { grid-template-columns: 110px 1fr !important; margin-bottom: 20px !important; }
@media (max-width: 900px) {
  .cols-interaction, .cols-release, .u-cols2 { grid-template-columns: 1fr !important; }
  .u-span2 { grid-column: auto !important; }
}
.ref-logo { max-width: 200px; max-height: 80px; object-fit: contain; border: 1px solid var(--line-soft); border-radius: var(--radius-md); padding: 8px; background: var(--surface-1); }
