/* Highview Portal: same look as the original launcher (navy ground, gold accent). */
:root {
  --bg: #0d1117; --card: rgba(22, 27, 34, .88); --card-solid: #161b22; --line: rgba(240, 246, 252, .1);
  --fg: #f0f6fc; --muted: #8b949e; --gold: #d4af37; --gold-soft: rgba(212, 175, 55, .16); --gold-fg: #0d1117;
  --ok: #56d364; --ok-soft: rgba(86, 211, 100, .14); --warn: #e3b341; --warn-soft: rgba(227, 179, 65, .14);
  --bad: #ff7b72; --bad-soft: rgba(255, 123, 114, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% 10%, #161e2e 0%, var(--bg) 90%) fixed; color: var(--fg); font: 15px/1.5 var(--font); }
a { color: var(--gold); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.top { display: flex; align-items: center; gap: 16px; padding: 14px max(20px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-weight: 600; }
.top .brand img { height: 30px; }
.top nav { display: flex; gap: 4px; margin-left: 12px; }
.top nav a { color: #c9d1d9; text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.top nav a.active, .top nav a:hover { background: var(--gold-soft); color: #f0d77a; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.top .who form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--gold); font: inherit; cursor: pointer; padding: 0; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 32px max(20px, env(safe-area-inset-left)) 48px; display: flex; flex-direction: column; gap: 24px; }
.narrow { max-width: 440px; margin: 0 auto; padding: 48px max(20px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 20px; }
.logo { text-align: center; }
.logo img { max-width: 220px; height: auto; }
h1 { margin: 0; font-size: 26px; font-weight: 600; text-align: center; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
.sub { color: var(--muted); margin: 0; text-align: center; }
.left { text-align: left; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
label { font-size: 13px; font-weight: 600; color: #c9d1d9; display: block; margin-bottom: 4px; }
.field { display: flex; flex-direction: column; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--fg); background: #0d1117; border: 1px solid #30363d; border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 70px; resize: vertical; }
.hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #30363d; border-radius: 10px; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--gold); }
.check small { display: block; color: var(--muted); }
.checks { display: flex; flex-direction: column; gap: 8px; }
button, .btn { font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; border: 1px solid #30363d; background: #21262d; color: var(--fg); cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
button.primary, .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-fg); }
button.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
button.small, .btn.small { padding: 5px 10px; font-size: 13px; }
.full { width: 100%; }
.msg { padding: 10px 14px; border-radius: 10px; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.err { background: var(--bad-soft); color: var(--bad); }
.msg.info { background: var(--gold-soft); color: #f0d77a; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: .05em; background: #0d1117; border: 1px dashed var(--gold); border-radius: 10px; padding: 10px 14px; user-select: all; text-align: center; }
.center { text-align: center; }

/* Launcher cards, as on the original page */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.app-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px 26px; text-decoration: none; color: var(--fg); display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.app-card:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 10px 30px var(--gold-soft); }
.app-icon { font-size: 34px; }
.app-card h2 { font-size: 20px; }
.app-card p { color: var(--muted); margin: 0; font-size: 14px; flex: 1; }
.launch { color: var(--gold); font-weight: 600; font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }

/* Admin */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.head h1, .head .sub { text-align: left; }
.table-wrap { overflow-x: auto; background: var(--card-solid); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td .muted, .muted { color: var(--muted); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.Active { background: var(--ok-soft); color: var(--ok); }
.pill.Pending { background: var(--warn-soft); color: var(--warn); }
.pill.Disabled, .pill.Denied { background: var(--bad-soft); color: var(--bad); }
.pill.admin { background: var(--gold-soft); color: #f0d77a; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; background: #21262d; color: #c9d1d9; margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.req { background: var(--warn-soft); color: var(--warn); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.footer { color: var(--muted); font-size: 13px; text-align: center; padding: 8px; }
@media (prefers-reduced-motion: reduce) { .app-card { transition: none; } .app-card:hover { transform: none; } }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
