/* HOP Partner / HOP Admin panels — the calm, light look of hop-app.eu (web/site/assets/css/site.css tokens). No inline styles anywhere (strict CSP). */
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/BricolageGrotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("/assets/fonts/MartianMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #F7F9FC; --bg2: #EEF3FA; --surface: #FFFFFF; --line: #E2E8F1;
  --ink: #0E1A33; --ink2: #4B5872; --ink3: #7C879C;
  --blue: #1F6BFF; --cyan: #19B4EE; --green: #0E9F6E; --green-dim: #E3F6EE; --red: #D92D20; --red-soft: #FDECEA;
  --partner: #5B3FD6; --partner-dim: #EEEAFD; --amber: #A85F00; --amber-dim: #FFF3DE;
  --shadow: 0 30px 80px -30px rgba(31, 107, 255, .35);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
a { color: var(--blue); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 8px;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 700; margin-top: 8px; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 10px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink2); }
.hint { color: var(--ink2); font-size: 14px; }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.select-all { user-select: all; }
.center { text-align: center; }
.lead { color: var(--ink2); max-width: 70ch; }

/* top bar */
.bar { background: color-mix(in srgb, var(--bg) 85%, transparent); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar-in { display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 0 20px; max-width: 1320px; margin: 0 auto; }
.brand { font: 800 18px/1 var(--display); color: var(--ink); text-decoration: none; display: inline-flex; gap: 10px; align-items: center; }
.brand-mark { width: 22px; height: 22px; background: var(--partner); border-radius: 6px; transform: rotate(45deg) scale(.8); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.who { font-weight: 600; color: var(--ink2); }
.langs { display: flex; gap: 4px; }
.langs a { font: 600 12px/1 var(--mono); color: var(--ink2); padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.langs a[aria-current] { background: var(--bg2); color: var(--ink); }
.bar.dark { background: var(--ink); border-bottom-color: var(--ink); }
.bar.dark .brand, .bar.dark .who, .bar.dark .session-left { color: #fff; }
.env { font: 700 11px/1 var(--mono); letter-spacing: .08em; background: var(--amber-dim); color: var(--amber); padding: 6px 8px; border-radius: 6px; }
.session-left { font: 500 12px/1 var(--mono); }

/* layout */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; max-width: 1320px; margin: 0 auto; padding: 24px 20px 64px; }
.content { max-width: 1040px; min-width: 0; }
.narrow { width: min(520px, 100%); margin: 48px auto; padding: 0 16px; }
.side .menu-mobile { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; position: sticky; top: 84px; }
.nav-list a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ink2); text-decoration: none; font-weight: 600; }
.nav-list a:hover { background: var(--bg2); color: var(--ink); }
.nav-list a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--blue); }
.nav-list .sep { border-top: 1px solid var(--line); margin: 8px 0; }
@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; gap: 12px; padding-top: 12px; }
  .side .menu-desktop { display: none; }
  .side .menu-mobile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; }
  .side summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
  .nav-list { position: static; }
}

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 16px; }
.card.auth { padding: 28px; }
.card.confirm { max-width: 640px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 8px; }
.title-row h1 { margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1 1 180px; }
.filters { margin: 8px 0 16px; }
.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.narrow-form { max-width: 520px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } }
.choice { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.or { text-align: center; color: var(--ink3); margin: 14px 0; }

/* forms */
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
textarea { resize: vertical; }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--red); }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 0 0 12px; }
legend { font-weight: 700; padding: 0 6px; }
.check { margin: 6px 0; }
.check label { font-weight: 500; }
.area-row { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 8px; }
.error { color: var(--red); font-size: 14px; margin: 4px 0 0; }
.counter { color: var(--ink3); font: 500 12px/1 var(--mono); float: right; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--blue); color: #fff; text-decoration: none; font: 700 15px/1.2 var(--body); padding: 11px 20px; border-radius: 999px; border: 1px solid var(--blue); cursor: pointer; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--surface); color: var(--red); border-color: var(--red); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.danger-link { color: var(--red); }

/* notices and badges */
.notice { border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; border: 1px solid var(--line); background: var(--surface); }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice.info { background: var(--bg2); border-color: var(--bg2); }
.notice.ok { background: var(--green-dim); border-color: var(--green); }
.notice.warn { background: var(--amber-dim); border-color: var(--amber); }
.notice.error { background: var(--red-soft); border-color: var(--red); }
.notice.explain { border-color: var(--blue); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); padding: 3px 10px; border-radius: 999px; background: var(--bg2); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; }
.badge.ok { color: var(--green); background: var(--green-dim); }
.badge.ok .dot { background: currentColor; }
.badge.wait { color: var(--amber); background: var(--amber-dim); }
.badge.bad { color: var(--red); background: var(--red-soft); }
.badge.bad .dot { border-radius: 2px; transform: rotate(45deg); }
.badge.off .dot { border-style: dashed; }
.partner-chip { display: inline-flex; align-items: center; gap: 4px; font: 700 12px/1 var(--body); color: var(--partner); background: var(--partner-dim); padding: 4px 8px; border-radius: 6px; vertical-align: middle; }
.partner-chip::before { content: ""; width: 8px; height: 8px; background: var(--partner); transform: rotate(45deg); }

/* tables */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--ink2); font-weight: 700; background: var(--bg); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 720px) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.list td { display: block; border: 0; padding: 4px 12px; }
}
.diff td, .diff th { font-size: 14px; }
pre.raw { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 13px/1.5 var(--mono); }

/* dashboard */
.partner-head { display: flex; gap: 16px; align-items: center; }
.partner-head .name, .biz .name { font: 700 18px/1.2 var(--display); margin: 0 0 4px; }
.avatar { width: 56px; height: 56px; border-radius: 16px; background: var(--partner-dim); color: var(--partner); display: inline-flex; align-items: center; justify-content: center; font: 800 18px/1 var(--display); flex: none; object-fit: cover; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.tile:hover { border-color: var(--blue); }
.tile-label { color: var(--ink2); font-weight: 600; font-size: 14px; }
.tile-value { font: 800 28px/1.1 var(--display); }
.tile-sub { color: var(--ink2); font-size: 13px; }
.rows { list-style: none; padding: 0; margin: 0 0 16px; }
.rows li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* previews */
.preview { position: sticky; top: 84px; }
.phone { width: min(360px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 28px; padding: 16px; }
.biz { background: var(--surface); border-radius: 18px; padding: 16px; }
.biz-rows { list-style: none; padding: 0; margin: 8px 0; color: var(--ink2); font-size: 14px; }
.desc { font-size: 14px; }
.plate { background: var(--surface); border: 1px solid var(--partner-dim); border-radius: 18px; padding: 14px; box-shadow: inset 3px 0 0 var(--partner); }
.plate-kicker { font: 600 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--partner); margin-bottom: 10px; }
.plate-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.plate-head .avatar { width: 40px; height: 40px; font-size: 14px; border-radius: 11px; }
.plate-name { font-weight: 700; margin: 0; }
.plate-paid { font-size: 12px; color: var(--ink2); margin: 0; }
.plate-title { font-weight: 700; margin: 6px 0 2px; }
.plate-text { white-space: pre-wrap; word-break: break-word; }
.plate-foot { display: flex; justify-content: space-between; color: var(--ink2); font-size: 13px; }

/* pairing, TOTP, stats */
.pair { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
@media (max-width: 640px) { .pair { grid-template-columns: 1fr; } }
.qr-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: inline-block; }
.qr { display: block; max-width: 100%; height: auto; }
.pair-code { font: 600 30px/1.2 var(--mono); letter-spacing: .06em; margin: 12px 0; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 24px; }
.chart { width: 100%; height: 160px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-bottom: 12px; }
.timeline { padding-left: 18px; }
.packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.package .price { font: 700 18px/1.3 var(--display); }
.danger-zone { border-color: var(--red); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
