/* Ludlow Synexis Licensing Server — console styles. No external fonts or frameworks (runs on internal servers). */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #dde3ea;
  --line-strong: #c5ced9;
  --text: #16202e;
  --muted: #5b6878;
  --navy: #12233f;
  --navy-2: #1b3157;
  --accent: #1f7fd1;
  --accent-soft: #e6f2fc;
  --sky: #4fb3f6;
  --ok: #15803d;   --ok-bg: #e8f6ee;
  --warn: #a15c07; --warn-bg: #fdf3e2;
  --bad: #b42318;  --bad-bg: #fdecea;
  --info: #3b5bab; --info-bg: #eaeffb;
  --focus: #4fb3f6;
  --radius: 8px;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d141f; --surface: #141d2b; --surface-2: #111925; --line: #243245; --line-strong: #31435b;
    --text: #e4eaf2; --muted: #93a1b4; --navy: #0a111b; --navy-2: #16243a; --accent: #4fa6ec; --accent-soft: #15283f;
    --ok: #4ade80; --ok-bg: #12291d; --warn: #f5b454; --warn-bg: #2d2212; --bad: #f87171; --bad-bg: #321717;
    --info: #93b4ff; --info-bg: #18213a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d141f; --surface: #141d2b; --surface-2: #111925; --line: #243245; --line-strong: #31435b;
  --text: #e4eaf2; --muted: #93a1b4; --navy: #0a111b; --navy-2: #16243a; --accent: #4fa6ec; --accent-soft: #15283f;
  --ok: #4ade80; --ok-bg: #12291d; --warn: #f5b454; --warn-bg: #2d2212; --bad: #f87171; --bad-bg: #321717;
  --info: #93b4ff; --info-bg: #18213a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .9em; }

/* ---------- shell ---------- */
body.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #cdd8e6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; color: #fff; text-decoration: none !important; border-bottom: 1px solid rgba(255,255,255,.08); }
.mark { width: 30px; height: 30px; border-radius: 7px; background: url("../favicon.svg") center / cover; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: .01em; }
.brand-text strong::after { content: "."; color: var(--sky); }
.brand-text span { font-size: 12px; color: #93a6c0; }
.side nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; overflow-y: auto; flex: 1; }
.side nav a { color: #cdd8e6; padding: 8px 12px; border-radius: 6px; font-size: 14px; text-decoration: none; }
.side nav a:hover { background: var(--navy-2); color: #fff; }
.side nav a.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--sky); }
.nav-head { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7488a4; padding: 16px 12px 4px; }
.who { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.who-name { color: #fff; font-weight: 600; }
.who-role { color: #93a6c0; font-size: 12px; }
.who-links a { color: #9fd3fa; }

.main { padding: 28px 36px 24px; max-width: 1280px; width: 100%; min-width: 0; }
.foot { margin-top: 48px; color: var(--muted); font-size: 12px; }

body.bare { display: grid; place-items: center; min-height: 100vh; }
body.bare .main { max-width: 440px; padding: 24px 16px; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > h2 { padding: 16px 20px 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel.flush .panel-head { padding: 14px 20px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.hint { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 24px 20px; text-align: center; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.alert .n { color: var(--warn); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .secondary { color: var(--muted); font-size: 12px; display: block; }
td.actions-cell { text-align: right; white-space: nowrap; }
.muted-row td { color: var(--muted); }

/* ---------- key/value ---------- */
dl.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.tag { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin: 1px 2px 1px 0; }

/* ---------- forms ---------- */
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .field > .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field .hint { margin-top: 3px; font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 8px 10px; min-height: 38px;
}
textarea { min-height: 90px; resize: vertical; }
textarea.code { font-family: var(--mono); font-size: 12px; }
input:disabled { background: var(--surface-2); color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400 !important; }
.check input { width: 16px; height: 16px; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .field { min-width: 160px; }
.filters .grow { flex: 1; min-width: 220px; }
.validation { color: var(--bad); font-size: 13px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none !important; min-height: 38px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line-strong)); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { font-size: 13px; padding: 4px 10px; min-height: 30px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 600; }

/* ---------- flash ---------- */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- secrets / keys ---------- */
.secret { display: flex; gap: 8px; align-items: stretch; }
.secret input, .secret code { flex: 1; font-family: var(--mono); font-size: 14px; }
.keybox { font-family: var(--mono); font-size: 17px; letter-spacing: .04em; padding: 10px 14px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 6px; user-select: all; overflow-wrap: anywhere; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; margin: 0 0 12px; }
.callout { border-left: 3px solid var(--warn); background: var(--warn-bg); padding: 10px 14px; border-radius: 0 6px 6px 0; margin-bottom: 16px; font-size: 14px; }

/* ---------- auth pages ---------- */
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: 100%; }
.auth-card .brand-line { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-card .brand-line strong::after { content: "."; color: var(--sky); }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn.primary { width: 100%; justify-content: center; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .who { display: none; }
  .main { padding: 18px 16px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
}

.narrow { max-width: 560px; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 20px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.panel-head .filters { margin: 0; width: 100%; }
.filters.panel-pad { padding: 14px 20px; border-top: 1px solid var(--line); margin: 0; background: var(--surface-2); }
