/* TEC OS licensing portal. Colours are the TEC OS operator window's own:
 * navy surfaces, the blue accent, and the tally colours (preview green,
 * overlay amber, program red) for states. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-var.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #090b17;
  --bg-deep: #070913;
  --panel: #0e1223;
  --card: #12172b;
  --raise: #171d36;
  --line: #1d2443;
  --line-2: #2a3460;
  --text: #f4f6fc;
  --text-2: #b4bcd8;
  --text-3: #8c96b9;
  --accent: #4c7dff;
  --accent-hi: #7da0ff;
  --accent-ink: #ffffff;
  --green: #2bc468;
  --amber: #f5ae30;
  --red: #e6333e;
  --red-hi: #ff6b73;
  --radius: 12px;
  --radius-sm: 8px;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --display: "Sora", "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pt-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgb(76 125 255 / 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgb(76 125 255 / 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-hi); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #a9c0ff; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 650; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 12px; }
code, .pt-mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0.01em; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 6px; }
.pt-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pt-skip { position: absolute; left: 12px; top: -48px; z-index: 10; padding: 8px 12px; background: var(--accent); color: #fff; border-radius: 8px; }
.pt-skip:focus { top: 12px; }
.pt-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pt-muted { color: var(--text-3); }
.pt-small { font-size: 13px; }
.pt-strong { font-weight: 600; }
.pt-right { text-align: right; }
.pt-nowrap { white-space: nowrap; }
.pt-big { font-size: 1.08em; }
.pt-pre { white-space: pre-wrap; }
.pt-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt-eyebrow { color: var(--accent-hi); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }

/* ---- Shell ---- */
.pt-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.pt-side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px;
  padding: 20px 14px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(14 18 35 / 0.92), rgb(9 11 23 / 0.92));
}
.pt-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; padding: 4px 8px; }
.pt-brand b { display: block; font: 700 17px/1.1 var(--display); letter-spacing: 0.02em; }
.pt-brand small { display: block; color: var(--text-3); font-size: 12px; letter-spacing: 0.04em; }
.pt-mark { width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 6px 18px -6px rgb(76 125 255 / 0.55); }
.pt-nav { display: grid; gap: 2px; }
.pt-nav__link {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 9px;
  color: var(--text-2); text-decoration: none; font: 500 14px/1.2 var(--sans); background: none; border: 0; cursor: pointer; text-align: left;
}
.pt-nav__link:hover { background: var(--card); color: var(--text); }
.pt-nav__link.is-active { background: linear-gradient(90deg, rgb(76 125 255 / 0.22), rgb(76 125 255 / 0.06)); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.pt-nav__link span { flex: 1; }
.pt-count { min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--amber); color: #1b1300; font: 700 12px/18px var(--sans); text-align: center; }
.pt-side__foot { margin-top: auto; display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.pt-side__foot form { margin: 0; }
.pt-who { margin: 10px 10px 0; display: grid; font-size: 13px; }
.pt-who small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }

.pt-main { padding: 28px clamp(16px, 3.4vw, 44px) 64px; min-width: 0; max-width: 1280px; }
.pt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pt-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-lead { margin: 8px 0 0; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

@media (max-width: 900px) {
  .pt-shell { grid-template-columns: minmax(0, 1fr); }
  .pt-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pt-nav { display: flex; overflow-x: auto; gap: 4px; order: 3; width: 100%; padding-bottom: 2px; scrollbar-width: thin; }
  .pt-nav__link { width: auto; white-space: nowrap; padding: 8px 10px; }
  .pt-nav__link.is-active { box-shadow: inset 0 -2px 0 var(--accent); }
  .pt-side__foot { margin: 0 0 0 auto; display: flex; padding: 0; border: 0; }
  .pt-side__foot .pt-nav__link span, .pt-who { display: none; }
  .pt-main { padding-top: 20px; }
}

/* ---- Buttons and inputs ---- */
.pt-btn {
  --btn-bg: var(--raise); --btn-fg: var(--text); --btn-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--btn-line); background: var(--btn-bg); color: var(--btn-fg);
  font: 600 14px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pt-btn:hover { color: var(--btn-fg); border-color: var(--accent); }
.pt-btn:active { transform: translateY(1px); }
.pt-btn:disabled { opacity: 0.6; cursor: progress; }
.pt-btn--primary { --btn-bg: linear-gradient(180deg, #5d8bff, #3f6cf0); --btn-fg: #fff; --btn-line: #6f98ff; box-shadow: 0 8px 22px -10px rgb(76 125 255 / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.18); }
.pt-btn--primary:hover { --btn-bg: linear-gradient(180deg, #6d97ff, #4c7dff); border-color: #9db7ff; }
.pt-btn--ghost { --btn-bg: transparent; }
.pt-btn--danger { --btn-bg: rgb(230 51 62 / 0.12); --btn-fg: #ffb3b8; --btn-line: rgb(230 51 62 / 0.45); }
.pt-btn--danger:hover { border-color: var(--red); }
.pt-btn--sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.pt-btn--lg { min-height: 48px; padding: 0 22px; font-size: 15px; }
.pt-btn.is-busy { position: relative; color: transparent; }
.pt-btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 0.35); border-top-color: #fff; animation: pt-spin 0.8s linear infinite; }
.pt-btn.is-done { border-color: var(--green); }
@keyframes pt-spin { to { transform: rotate(360deg); } }

.pt-form { display: grid; gap: 16px; }
.pt-form h2 { margin-bottom: 2px; }
.pt-form__foot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pt-form__foot p { margin: 0; }
.pt-field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pt-field__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.pt-field__label em { font-style: normal; font-weight: 400; color: var(--text-3); }
.pt-field__hint { font-size: 12.5px; color: var(--text-3); }
.pt-field__error { font-size: 13px; color: var(--red-hi); }
.pt-field.has-error .pt-input { border-color: var(--red); box-shadow: 0 0 0 3px rgb(230 51 62 / 0.18); }
.pt-input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-deep); color: var(--text); font: 400 15px/1.4 var(--sans); transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.pt-input { resize: vertical; min-height: 84px; }
.pt-input.pt-mono { font-family: var(--mono); letter-spacing: 0.04em; }
.pt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(76 125 255 / 0.25); }
.pt-input[readonly] { color: var(--text-2); background: var(--panel); }
.pt-input--sm { min-height: 32px; padding: 4px 10px; font-size: 13px; width: 170px; }
input[type="date"].pt-input { color-scheme: dark; }
.pt-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .pt-grid2 { grid-template-columns: minmax(0, 1fr); } }
.pt-seg__row { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-seg__opt { position: relative; }
.pt-seg__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pt-seg__opt span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 14px; font-weight: 500; }
.pt-seg__opt input:checked + span { background: rgb(76 125 255 / 0.18); border-color: var(--accent); color: #fff; }
.pt-seg__opt input:focus-visible + span { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.pt-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pt-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

/* ---- Surfaces ---- */
.pt-panel, .pt-card {
  position: relative; background: linear-gradient(180deg, rgb(18 23 43 / 0.92), rgb(14 18 35 / 0.92));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04), 0 18px 40px -28px rgb(0 0 0 / 0.8);
}
.pt-panel--accent { border-color: rgb(76 125 255 / 0.55); box-shadow: 0 0 0 1px rgb(76 125 255 / 0.25), 0 20px 50px -30px rgb(76 125 255 / 0.6); }
.pt-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pt-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.pt-cols > * { margin-bottom: 0; }
.pt-cols + * { margin-top: 18px; }
@media (max-width: 1100px) { .pt-cols { grid-template-columns: minmax(0, 1fr); } }
.pt-link { font-size: 13px; font-weight: 600; text-decoration: none; }

.pt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pt-stat { display: grid; gap: 2px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.pt-stat:hover { border-color: var(--line-2); transform: translateY(-1px); color: var(--text); }
.pt-stat__value { font: 650 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.pt-stat__label { font-size: 13px; color: var(--text-3); }
.pt-stat--warn { border-color: rgb(245 174 48 / 0.45); }
.pt-stat--warn .pt-stat__value { color: var(--amber); }

.pt-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); background: var(--panel); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pt-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table tbody tr:hover td { background: rgb(76 125 255 / 0.04); }
.pt-table td small { display: block; color: var(--text-3); font-size: 12.5px; }
.pt-table .pt-ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.pt-table--audit .pt-detail { max-width: 420px; overflow-wrap: anywhere; }

.pt-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pt-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pt-badge--active, .pt-badge--approved { color: #6be59a; background: rgb(43 196 104 / 0.12); border-color: rgb(43 196 104 / 0.35); }
.pt-badge--expiring, .pt-badge--pending, .pt-badge--approving { color: #ffc867; background: rgb(245 174 48 / 0.12); border-color: rgb(245 174 48 / 0.35); }
.pt-badge--expired, .pt-badge--declined { color: #ff9aa0; background: rgb(230 51 62 / 0.12); border-color: rgb(230 51 62 / 0.35); }
.pt-badge--scheduled { color: var(--accent-hi); background: rgb(76 125 255 / 0.12); border-color: rgb(76 125 255 / 0.35); }
.pt-badge--superseded { color: var(--text-3); background: rgb(140 150 185 / 0.1); border-color: rgb(140 150 185 / 0.3); }
.pt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; border: 1px solid var(--line-2); }
.pt-chip .pt-icon { width: 15px; height: 15px; }
.pt-chip--ok { color: #8be8af; border-color: rgb(43 196 104 / 0.4); background: rgb(43 196 104 / 0.08); }
.pt-chip--bad { color: #ffb3b8; border-color: rgb(230 51 62 / 0.45); background: rgb(230 51 62 / 0.08); }
.pt-action { font-weight: 600; }
.pt-action--license { color: #8be8af; }
.pt-action--request { color: #ffc867; }
.pt-action--auth, .pt-action--passkey { color: var(--accent-hi); }
.pt-action--admin { color: #d3b4ff; }

.pt-list { list-style: none; margin: 0; padding: 0; display: grid; }
.pt-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pt-list li:last-child { border-bottom: 0; }
.pt-list li > a, .pt-list li > span:first-child { display: grid; gap: 2px; min-width: 0; color: var(--text); text-decoration: none; }
.pt-list li > a span, .pt-list li > span:first-child > span { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.pt-list li > a:hover b { color: var(--accent-hi); }
.pt-list form { margin: 0; }
.pt-list--keys li { flex-wrap: wrap; }

.pt-dl { display: grid; margin: 4px 0 0; }
.pt-dl > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pt-dl > div:last-child { border-bottom: 0; }
.pt-dl dt { color: var(--text-3); font-size: 13.5px; }
.pt-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .pt-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.pt-key { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 10px; background: var(--bg-deep); border: 1px dashed var(--line-2); margin-bottom: 12px; }
.pt-key__text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; color: #dfe7ff; user-select: all; }
.pt-message { margin: 0; padding: 14px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--line); font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }

.pt-flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.pt-flash--ok { color: #b8f3cd; border-color: rgb(43 196 104 / 0.45); background: rgb(43 196 104 / 0.1); }
.pt-flash--warn { color: #ffe1a8; border-color: rgb(245 174 48 / 0.45); background: rgb(245 174 48 / 0.1); }
.pt-flash--bad { color: #ffc2c6; border-color: rgb(230 51 62 / 0.5); background: rgb(230 51 62 / 0.1); }

.pt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pt-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.pt-tab { padding: 7px 12px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: 13.5px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.pt-tab:hover { color: var(--text); background: var(--card); }
.pt-tab.is-active { background: var(--raise); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.pt-search { display: flex; gap: 6px; margin: 0; flex: 1; max-width: 420px; min-width: 220px; }
.pt-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.pt-pager__page { color: var(--text-3); font-size: 13px; }
.pt-empty { padding: 22px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: 10px; }
.pt-empty p { margin: 0 0 6px; }

/* ---- Public pages (activation, sign-in) ---- */
.pt-public { display: flex; flex-direction: column; }
.pt-topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 40px); }
.pt-public__main { width: 100%; max-width: 860px; margin: 0 auto; padding: 8px 16px 40px; flex: 1; }
.pt-public__main.is-narrow { max-width: 720px; }
.pt-public__foot { text-align: center; color: var(--text-3); font-size: 13px; padding: 24px 16px 32px; }
.pt-card { padding: clamp(20px, 3.4vw, 32px); }
.pt-card h1 { margin-bottom: 10px; }
.pt-card--quiet { background: var(--panel); box-shadow: none; }
.pt-hero-card { background: radial-gradient(600px 220px at 100% 0%, rgb(76 125 255 / 0.18), transparent 70%), linear-gradient(180deg, #141a33, #0e1223); }
.pt-center { text-align: center; }
.pt-auth { text-align: center; display: grid; justify-items: center; gap: 6px; max-width: 520px; margin: 6vh auto 0; }
.pt-auth--wide { max-width: 560px; text-align: left; justify-items: stretch; }
.pt-auth--wide > .pt-auth__mark, .pt-auth--wide > .pt-eyebrow { justify-self: center; }
.pt-auth--wide > h1, .pt-auth--wide > p { text-align: center; }
.pt-auth__mark { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 8px; box-shadow: 0 18px 40px -16px rgb(76 125 255 / 0.7); }
.pt-auth .pt-btn--lg { margin-top: 10px; }
.pt-auth__status { min-height: 22px; margin: 6px 0 0; font-size: 14px; color: var(--text-2); }
.pt-auth__status[data-kind="bad"] { color: var(--red-hi); }
.pt-auth__status[data-kind="ok"] { color: #8be8af; }
.pt-status-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pt-steps { margin: 6px 0 18px; padding-left: 22px; display: grid; gap: 6px; color: var(--text-2); }
.pt-ref { display: inline-flex; gap: 12px; align-items: baseline; padding: 12px 16px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--line-2); margin: 6px 0 10px; }
.pt-ref span { color: var(--text-3); font-size: 13px; }
.pt-ref b { font-size: 20px; letter-spacing: 0.08em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
