/* SoftN Hub — navy + gold, like the SoftN Invoicing console. Works on phones (menu slides in). */
:root {
  --navy: #0f1d3a; --navy-2: #16274d; --gold: #c9a227; --gold-soft: #f6edd0;
  --ink: #1b2233; --muted: #6b7386; --line: #e5e8ef; --bg: #f3f5f9; --white: #fff;
  --green: #1f9d55; --amber: #d98a04; --red: #c8372d; --blue: #2563eb;
  --radius: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.75rem; margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* sidebar */
.side { position: fixed; inset: 0 auto 0 0; width: 232px; background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: #dfe5f2; display: flex; flex-direction: column; padding: 14px 12px; z-index: 20; transition: transform .2s; }
.brand { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: var(--radius);
  background: linear-gradient(135deg, #1c1a14, #2b2717); border: 1px solid #6f5a1c; color: #fff; text-decoration: none !important; }
.brand b { display: block; letter-spacing: .06em; }
.brand small { display: block; color: #cdb874; font-size: .75rem; }
.brand.dark { margin-bottom: 1.2rem; }
.logo { width: 42px; height: 42px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
  font-size: 1.5rem; color: var(--navy); background: linear-gradient(135deg, #f1d978, var(--gold)); }
.nav-head { font-size: .7rem; letter-spacing: .14em; color: #8d9abb; margin: 1.4rem .5rem .5rem; }
.side nav a { display: flex; gap: 12px; align-items: center; padding: 11px 12px; margin-bottom: 4px; border-radius: 10px;
  color: #e7ecf7; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.side nav a i { font-style: normal; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px;
  background: rgba(255,255,255,.07); }
.side nav a:hover { background: rgba(255,255,255,.06); }
.side nav a.on { background: rgba(201,162,39,.14); border-color: #6f5a1c; }
.side nav a.on i { background: var(--gold); color: var(--navy); }
.me { margin-top: auto; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; padding: 10px;
  border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); }
.me b { display: block; font-size: .9rem; }
.me small { color: #9aa6c4; font-size: .75rem; }
.me form { grid-column: 1 / -1; }
.me .btn { width: 100%; color: #dfe5f2; border-color: rgba(255,255,255,.18); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid;
  place-items: center; font-weight: 800; }
.foot { font-size: .7rem; color: #7f8cab; text-align: center; margin: .6rem 0 0; }

/* top bar + page */
.main { margin-left: 232px; min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: var(--white); border-bottom: 1px solid var(--line); }
.top-title { font-weight: 700; }
.search { margin-left: auto; width: min(420px, 50%); }
.search input { width: 100%; }
.burger { display: none; font-size: 1.4rem; cursor: pointer; padding: 0 6px; }
.menu-toggle { display: none; }
.page { padding: 24px; max-width: 1400px; }

/* controls */
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid #cfd5e1; border-radius: 9px; background: #fff;
  color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(201,162,39,.45); border-color: var(--gold); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 9px 16px; border-radius: 9px; border: 1px solid #cfd5e1; background: #fff; color: var(--ink); cursor: pointer;
  text-decoration: none !important; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn.gold { background: linear-gradient(135deg, #e2c25a, var(--gold)); border-color: #a9861a; color: #1d1606; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.wide { width: 100%; padding: 12px; margin-top: .4rem; }
.btn.link { border: 0; background: none; color: var(--muted); padding: 8px 0; margin-top: .4rem; }

.flash { padding: 10px 14px; border-radius: 9px; background: #e8f6ee; color: #145c34; border: 1px solid #b9e3c9; }
.flash.error { background: #fdecea; color: #8a1f17; border-color: #f3c1bc; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: var(--radius);
  padding: 16px 18px; color: var(--ink); text-decoration: none !important; display: flex; flex-direction: column; gap: 4px;
  min-width: 0; }
a.card:hover { box-shadow: 0 4px 14px rgba(15,29,58,.08); }
.card span { color: var(--muted); font-size: .85rem; }
.card b { font-size: 1.9rem; font-weight: 600; }
.card b.text { font-size: 1.05rem; overflow-wrap: anywhere; }
.card small { color: var(--muted); font-size: .8rem; }
.card.gold { border-left-color: var(--gold); } .card.green { border-left-color: var(--green); }
.card.amber { border-left-color: var(--amber); } .card.red { border-left-color: var(--red); }
.card.blue { border-left-color: var(--blue); }

/* panels + tables */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h1, .panel-head h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { background: var(--navy); color: #fff; text-align: left; padding: 10px 12px; font-weight: 600; white-space: nowrap; }
th:first-child { border-radius: 8px 0 0 0; } th:last-child { border-radius: 0 8px 0 0; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #fafbfd; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: #eef1f6; color: var(--muted); border: 1px solid var(--line); }
.badge.active { background: #e6f6ed; color: #17703d; border-color: #bfe5cf; }
.badge.expiring { background: #fff4df; color: #8a5600; border-color: #f2d59c; }
.badge.expired, .badge.blocked { background: #fdecea; color: #9b241b; border-color: #f3c1bc; }
.badge.read_only { background: #e9f0fe; color: #1d4bb3; border-color: #c3d4fb; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { flex: 1 1 240px; width: auto; } .filters select { width: auto; }

/* forms */
.form h2 { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.form h2:first-of-type { margin-top: 0; padding-top: 0; border: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.field small { font-weight: 400; color: var(--muted); }
.field .err { color: var(--red); font-weight: 500; }
.field.bad input, .field.bad select { border-color: var(--red); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }

/* plans */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 14px; }
.modules { margin: 4px 0 12px; font-size: .9rem; }
.modules summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.module-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.module-list label, .check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.module-list input, .check input { width: auto; }

/* login pages */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 30% 20%, #23386b, var(--navy) 60%); }
.auth-card { width: min(400px, 100%); background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 1.4rem; }
.auth-card label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.steps { padding-left: 1.2rem; line-height: 1.6; margin-top: 0; }
.qr { display: grid; place-items: center; margin: 6px 0 14px; }
.qr svg { width: 220px; height: 220px; display: block; }
.manual { background: #f6f7fa; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
  font-size: .9rem; }
.manual summary { cursor: pointer; font-weight: 600; }
.manual .steps { margin: .6rem 0 0; }
.key { font-family: Consolas, "Courier New", monospace; font-size: 1rem; font-weight: 700; letter-spacing: .04em;
  background: #fff; border: 1px dashed #b9a050; border-radius: 6px; padding: 2px 6px; word-break: break-word; }

/* phones and half-screen windows */
@media (max-width: 900px) {
  .side { transform: translateX(-100%); }
  .menu-toggle:checked ~ .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .burger { display: block; }
  .top { padding: 10px 14px; }
  .search { width: auto; flex: 1; }
  .top-title { display: none; }
  .page { padding: 16px 12px; }
  h1 { font-size: 1.4rem; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 12px 14px; }
  .card b { font-size: 1.5rem; }
  .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; }
}

/* step 3b: the hub key, server identity */
code.key { display: block; padding: 10px 12px; background: #f4f6fb; border: 1px solid #dde3ef; border-radius: 8px; word-break: break-all; font-size: .8rem; }

/* step 3c: job log, password box */
pre.joblog { background: #0f1b33; color: #e8edf7; padding: 14px 16px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; font-size: .82rem; min-height: 120px; }
input.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; }
