:root {
  --navy: #1F3864; --navy-dark: #142748; --ink: #1B2333; --muted: #4A5568; --faint: #5A6578;
  --line: #E2E6EC; --field: #C9D0DA; --ground: #F5F6F8; --white: #FFFFFF;
  --red: #A1271B; --red-bg: #FDECEA; --green: #05603A; --green-bg: #E3F4EA;
  --amber: #6B4300; --amber-bg: #FFF8E8; --blue-bg: #E8EEF8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--ground); font-size: 15px; line-height: 1.45; }
a { color: var(--navy); }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* login */
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.logo { width: 56px; height: 56px; border-radius: 14px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.brand-name { font-size: 20px; font-weight: 700; }
.tabs { display: flex; background: #E7EAF0; border-radius: 12px; padding: 4px; }
.tabs button { flex: 1; height: 44px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; height: 46px; border: 1px solid var(--field); border-radius: 10px; padding: 0 12px; color: var(--ink); background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #9DB4DD; outline-offset: 1px; }
input.code { font-size: 22px; letter-spacing: 6px; }
.btn { height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--navy-dark); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: var(--blue-bg); }
.btn.small { height: 36px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.msg { border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.msg.error { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--green-bg); color: var(--green); }
.msg.info { background: var(--blue-bg); color: var(--navy); }
.msg.warn { background: var(--amber-bg); color: var(--amber); border: 1px solid #F3D9A4; }
.qr { display: flex; justify-content: center; }
.qr img { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--ground); border-radius: 8px; padding: 8px 10px; }
.foot-note { text-align: center; font-size: 12px; color: var(--faint); }

/* shell */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 220px; max-width: 240px; background: var(--navy); color: #fff; padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; }
.side .who { padding: 0 10px 16px; display: flex; gap: 10px; align-items: center; }
.side .who .logo { width: 36px; height: 36px; border-radius: 9px; background: #fff; color: var(--navy); font-size: 14px; }
.side a, .side button.link { color: #D7DFEE; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 14px; background: none; border: none; text-align: left; font: inherit; cursor: pointer; }
.side a:hover, .side button.link:hover { background: rgba(255,255,255,.08); color: #fff; }
.side a.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.side .soon { color: #9FB0CF; padding: 10px 12px; font-size: 14px; display: flex; justify-content: space-between; }
.side .soon span { font-size: 11px; border: 1px solid #5B6F96; border-radius: 999px; padding: 0 6px; }
.side .bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.main { flex: 999 1 560px; min-width: 0; padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }
.topline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.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: 13px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
td { padding: 10px 6px; border-bottom: 1px solid #EEF0F4; vertical-align: middle; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; display: inline-block; }
.pill.on { background: var(--green-bg); color: var(--green); }
.pill.off { background: #EEF0F4; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row .field { flex: 1 1 180px; }
.trial-badge { font-size: 12px; color: var(--amber); background: var(--amber-bg); border: 1px solid #F3D9A4; border-radius: 999px; padding: 2px 10px; }

@media (max-width: 700px) {
  .shell { align-content: flex-start; }
  .side { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-start; padding: 10px; gap: 4px; }
  .side .who { flex-basis: 100%; padding-bottom: 6px; }
  .side .soon { display: none; }
  .side .bottom { margin-top: 0; border-top: none; padding-top: 0; flex-direction: row; align-items: center; }
  .side a, .side button.link { padding: 8px 10px; }
  .main { padding: 18px 14px; }
}
