/* MVG portal — same palette as the public site so the two read as one product.
   Swap these tokens when the real MVG branding lands. */
:root {
  /* MVG brand, from the logo artwork: #00384c navy, #00aaaa teal, #d9e3eb pale. */
  --brand: #00384c;
  --brand-600: #002c3c;
  --brand-800: #001a24;
  --brand-50: #eaf2f6;
  --accent: #00aaaa;
  --accent-600: #00696b;
  --canvas: #f4f7f9;
  --surface: #fff;
  --ink: #0c2632;
  --ink-soft: #41616f;
  --ink-faint: #56737f;
  --line: #dde5ea;
  --line-strong: #8ba0ab;
  --danger: #a4262c;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(12 38 50 / .05), 0 10px 30px -14px rgb(12 38 50 / .18);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1 { font-size: 1.75rem; letter-spacing: -.02em; margin: 1.5rem 0 .5rem; }
h2 { font-size: 1.15rem; letter-spacing: -.01em; margin: 0 0 .6rem; }
a { color: var(--brand); }
.wrap { max-width: 940px; margin: 0 auto; padding: 0 1rem; }
.muted { color: var(--ink-faint); }
small { display: block; color: var(--ink-faint); font-size: .82rem; margin-top: .3rem; }

/* header */
.topbar { background: var(--brand-800); color: #fff; }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: .85rem 1rem; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.brand em { font-style: normal; font-weight: 600; color: rgb(255 255 255 / .7); }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; margin-right: auto; }
.topbar nav a {
  color: rgb(255 255 255 / .75); text-decoration: none;
  padding: .35rem .8rem; border-radius: 999px; font-size: .93rem;
}
.topbar nav a:hover { background: rgb(255 255 255 / .1); color: #fff; }
.topbar nav a.on { background: #fff; color: var(--brand-800); font-weight: 600; }
.who { display: flex; gap: .9rem; align-items: center; font-size: .9rem; }
.who a { color: rgb(255 255 255 / .8); text-decoration: none; }
.who a:hover { color: #fff; }

/* blocks */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow);
  margin: 1rem 0;
}
.card.auth { max-width: 420px; margin: 3rem auto; }
.card.empty { text-align: center; color: var(--ink-faint); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.stat { text-align: center; }
.stat .n { display: block; font-size: 2.1rem; font-weight: 800; color: var(--brand); }
.stat .l { color: var(--ink-faint); font-size: .9rem; }
.stat.warn .n { color: var(--accent-600); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* forms */
label { display: block; margin: 0 0 1rem; font-weight: 600; font-size: .93rem; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=date], input[type=number], select, textarea {
  width: 100%; margin-top: .35rem; padding: .6rem .7rem;
  border: 1px solid var(--line-strong); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(0 56 76 / .18);
}
.check { display: block; margin-top: .35rem; }
.check input { width: auto; }
.form .row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form .row { grid-template-columns: 1fr 1fr; } }
label.narrow { max-width: 220px; }
.actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }

button, .btn {
  display: inline-block; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand); color: #fff; font: inherit; font-weight: 600;
  padding: .6rem 1.4rem; text-decoration: none;
}
button:hover, .btn:hover { background: var(--brand-600); }
.btn.ghost, button.ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong);
}
.btn.ghost:hover, button.ghost:hover { border-color: var(--brand); color: var(--brand); }
button.link {
  background: none; color: var(--brand); padding: 0 .4rem; font-weight: 600;
}
button.link:hover { background: none; text-decoration: underline; }
button.link.danger { color: var(--danger); }
form.inline { display: inline; }

/* tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1rem 0; }
.table th, .table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); font-size: .93rem; }
.table th { background: var(--brand-50); color: var(--brand-800); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; white-space: nowrap; }
.table tr.dim { opacity: .55; }

.pill { display: inline-block; padding: .12rem .6rem; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-800); font-size: .78rem; font-weight: 700; text-transform: capitalize; }
.pill.published { background: #e3f3e8; color: #1f6b3a; }
.pill.draft { background: #f0f2f5; color: var(--ink-soft); }
.pill.archived { background: #f3eee6; color: var(--accent-600); }
.pill.warn { background: #fdf1dc; color: var(--accent-600); }

/* tabs, flashes, misc */
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: 1rem 0; }
.tabs a { padding: .4rem .9rem; border-radius: 999px; text-decoration: none;
  color: var(--ink-soft); background: #fff; border: 1px solid var(--line); font-size: .9rem; }
.tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

.flash { padding: .7rem 1rem; border-radius: 10px; margin: 1rem 0; font-size: .93rem; }
.flash.ok { background: #e3f3e8; color: #1f6b3a; }
.flash.error { background: #fbeaea; color: var(--danger); }
.flash.warn { background: #fdf1dc; color: var(--accent-600); }
.live-ok { color: #1f6b3a; font-weight: 600; }

.tick { padding-left: 1.1rem; color: var(--ink-soft); }
.secret { font-family: ui-monospace, monospace; font-size: 1.1rem; letter-spacing: .08em;
  background: var(--brand-50); padding: .7rem 1rem; border-radius: 10px; word-break: break-all; }
.foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--ink-faint); font-size: .82rem; padding-top: 2rem; padding-bottom: 2rem; }
.foot a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.foot a:hover { color: var(--brand); text-decoration: underline; }

/* two-step enrollment: QR beside the typed key */
.enroll { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: start; margin: 1rem 0 1.25rem; }
@media (min-width: 620px) { .enroll { grid-template-columns: auto 1fr; } }
.qr { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.qr svg { width: 190px; height: 190px; display: block;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .5rem; }
.qr .muted { font-size: .8rem; }
.enroll-alt p:first-child { margin-top: 0; }

/* content editor */
.field-label { display: flex; align-items: center; gap: .5rem; }
.field-label .pill { background: #fdf1dc; color: var(--accent-600); text-transform: none; font-size: .7rem; }
textarea.cards { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }

.card.nudge { border-left: 4px solid var(--accent); background: var(--brand-50); }
.card.nudge h2 { color: var(--brand); }
.small-link { line-height: 1.9; }

/* brand marks */
.brand { display: flex; align-items: center; gap: .6rem; }
.brand-logo { height: 44px; width: auto; display: block; }
.auth-logo { display: block; width: 132px; height: auto; margin: 0 auto .75rem; }
.card.auth { text-align: center; }
.card.auth form, .card.auth label { text-align: left; }

.pinbox { background: var(--brand-50); border-radius: 12px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.pinbox strong { display: block; margin-bottom: .25rem; }
.pinbox p { margin: 0 0 .6rem; color: var(--ink-soft); font-size: .93rem; }
.pinbox summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .9rem; }
.pinbox details[open] summary { margin-bottom: .6rem; }

/* profile avatar + remember-this-device */
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: var(--brand-800); font-weight: 800; font-size: .85rem;
  letter-spacing: .02em; text-decoration: none; border: 2px solid rgb(255 255 255 / .25); }
.avatar:hover { background: #fff; color: var(--brand-800); }
.checkline { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .9rem; }
.checkline input { width: auto; margin-top: .2rem; }
.devices td { font-size: .9rem; }
