/* myb POC - built to the Loqui / MYB HQ design specification (LOQUI-DESIGN.md).
   Tokens copied from the spec's paste-in token sheet (Part 1 §8); components from Part 1 §7. */

@font-face { font-family: 'Gilroy'; src: url('/fonts/gilroy-medium.woff2') format('woff2'); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gilroy'; src: url('/fonts/gilroy-bold.woff2') format('woff2'); font-weight: 600 900; font-style: normal; font-display: swap; }

/* ═══ Tokens · dark is :root, light is html.light ═══ */
:root {
  --lq-navy: #070d1f;
  --lq-ease: cubic-bezier(.2, .8, .2, 1); --lq-spring: cubic-bezier(.32, .72, 0, 1); --lq-bounce: cubic-bezier(.34, 1.4, .64, 1);
  --lq-fast: 140ms; --lq-base: 220ms; --lq-slow: 420ms; --lq-stagger: 45ms;
  --lq-radius: 22px; --lq-radius-sm: 16px; --lq-radius-xs: 12px;

  --bg-body: #080c19; --bg-card: #161e34; --bg-input: #101729; --bg-hover-subtle: #1f2942; --bg-hover-accent: #282b49;
  --lq-panel: #161e34; --lq-panel-alt: #1f2942;
  --lq-line: #30394f; --lq-line-soft: #262f47; --border-input: #3a4460;
  --border-hover: color-mix(in srgb, #b78af7 55%, #30394f);
  --text-primary: #f5f3fb; --text-secondary: #d3d7e6; --text-tertiary: #b3b9cf; --text-faint: #a3abc2; --text-accent: #b78af7;
  --lq-accent: #b78af7; --lq-accent-strong: #c9a6fa; --lq-accent-ink: #111a39; --lq-accent-deep: #7133db; --lq-tint: #211b38;
  --lq-good: #82d4b1; --lq-bad: #ffa4bb; --lq-amber: #e8c278; --lq-blue: #86c9ee; --lq-slate: #8f99b3;
  --lq-shadow-rest: 0 1px 2px #0005, 0 8px 24px #0004;
  --lq-shadow-hover: 0 2px 6px #0007, 0 24px 52px -12px #000a, 0 0 0 1px color-mix(in srgb, var(--lq-accent) 22%, transparent);
  --lq-shadow-pop: 0 4px 10px #0006, 0 30px 70px -18px #000c;
  --lk-fg: var(--text-primary); --lk-muted: var(--text-tertiary); --lk-faint: color-mix(in srgb, var(--text-tertiary) 70%, transparent);
  --lk-line: var(--lq-line); --lk-panel: var(--bg-card); --lk-accent: var(--lq-accent);
  --lk-tint: color-mix(in srgb, var(--lq-accent) 16%, var(--bg-card));
  --lk-good: #5fcaa0; --lk-bad: #ff8fa9; --lk-amber: #f0c060; --lk-slate: #6f7891;
  --lk-hover: color-mix(in srgb, var(--lq-accent) 7%, transparent);
  --lk-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 30px -18px rgba(0, 0, 0, .55);
  --lk-r: 20px;
  color-scheme: dark;
}
html.light {
  --bg-body: #f6f3fc; --bg-card: #fff; --bg-input: #fff; --bg-hover-subtle: #f4f6fa; --bg-hover-accent: #f4effe;
  --lq-panel: #fff; --lq-panel-alt: #f4f6fa;
  --lq-line: #e4e7ee; --lq-line-soft: #eef0f5; --border-input: #d6dbe7;
  --border-hover: color-mix(in srgb, #7133db 45%, #e4e7ee);
  --text-primary: #111a39; --text-secondary: #38415e; --text-tertiary: #5f6880; --text-faint: #6b6880; --text-accent: #7133db;
  --lq-accent: #7133db; --lq-accent-strong: #5f27c4; --lq-accent-ink: #fff; --lq-accent-deep: #7133db; --lq-tint: #f7f2ff;
  --lq-good: #167b63; --lq-bad: #b62645; --lq-amber: #956208; --lq-blue: #297cbd; --lq-slate: #6b7590;
  --lq-shadow-rest: 0 1px 2px #1d10400a, 0 6px 22px #321b650a;
  --lq-shadow-hover: 0 2px 4px #1d104010, 0 22px 48px -14px #3b1d7a33;
  --lq-shadow-pop: 0 4px 12px #1d104014, 0 30px 70px -20px #3b1d7a40;
  --lk-tint: #f1eafd;
  --lk-good: #1f9b7b; --lk-bad: #d4466a; --lk-amber: #e0a21b; --lk-slate: #9aa2b6;
  --lk-shadow: 0 1px 2px rgba(17, 26, 57, .04), 0 12px 32px -20px rgba(57, 34, 76, .28);
  color-scheme: light;
}

/* ═══ Base ═══ */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-family: 'Gilroy', Arial, sans-serif; font-size: 14px; line-height: 1.55;
  font-feature-settings: "ss01" 1; -webkit-font-smoothing: antialiased; color: var(--text-primary); background: var(--bg-body); }
h1, h2, h3, h4 { letter-spacing: -.3px; margin: 0; }
button { font-family: inherit; }
a { color: var(--text-accent); text-decoration: none; }
:focus { outline: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--lq-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--lq-accent) 28%, transparent); }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-tertiary) 36%, transparent) transparent; }
.bg { position: fixed; inset: 0; z-index: -2; background: var(--bg-body); }
html.light .bg { background: radial-gradient(1200px 520px at 50% -160px, #ece2ff 0%, transparent 70%), var(--bg-body); }
@media (max-width: 640px) { body { font-size: 15px; } }

/* Icons: 24×24 line set, stroke currentColor, sized by the text */
.lk-icon { display: inline-grid; place-items: center; flex: none; width: 1em; height: 1em; line-height: 0; }
.lk-icon svg { width: 100%; height: 100%; }

/* ═══ Top bar (navy in both themes) ═══ */
.topbar { position: sticky; top: 0; z-index: 70; display: flex; align-items: center; height: 64px; padding: 0 28px; gap: 22px;
  background: var(--lq-navy); border-bottom: 1px solid #ffffff14; color: #fff; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 30px; width: auto; display: block; }
.topbar-title { color: #c4c5d1; font: 700 10.5px/1 'Gilroy', sans-serif; letter-spacing: 1.6px; text-transform: uppercase;
  border-left: 1px solid #ffffff24; padding-left: 18px; }
.crumb { display: inline-flex; gap: 12px; align-items: center; color: #aab0c8; font: 600 15px/1.2 'Gilroy', sans-serif; }
.crumb [aria-current] { color: #fff; }
.topbar-grow { flex: 1; }
.barpill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; background: #ffffff10;
  border: 1px solid #ffffff24; color: #dfe2f0; font: 700 12px 'Gilroy', sans-serif; white-space: nowrap; }
.barpill-dot { width: 8px; height: 8px; border-radius: 50%; background: #82d4b1; box-shadow: 0 0 0 3px color-mix(in srgb, #82d4b1 22%, transparent); }
.topbar .ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 14px; border-radius: 999px;
  background: #ffffff12; border: 1px solid #ffffff38; color: #fff; cursor: pointer;
  transition: background-color var(--lq-fast) var(--lq-ease), border-color var(--lq-fast) var(--lq-ease), transform var(--lq-base) var(--lq-spring); }
.topbar .ghost:hover { background: #ffffff24; border-color: #ffffff60; }
.topbar .ghost:active { transform: scale(.96); }
.topbar .ghost.theme { width: 38px; padding: 0; font-size: 0; }
.topbar .ghost.theme::before { content: ''; width: 17px; height: 17px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
  transition: transform 500ms var(--lq-spring);
  --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.900 4.900l1.400 1.400M17.700 17.700l1.400 1.400M2 12h2M20 12h2M4.900 19.100l1.400-1.400M17.700 6.300l1.400-1.400'/%3E%3C/svg%3E"); }
html.light .topbar .ghost.theme::before { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.500A8 8 0 0 1 9.500 4a8 8 0 1 0 10.500 10.500z'/%3E%3C/svg%3E"); }
.topbar .ghost.theme:hover::before { transform: rotate(30deg); }
@media (max-width: 1000px) { .topbar { padding: 0 14px; gap: 10px; } .topbar-title, .crumb { display: none; } }

/* ═══ Page ═══ */
.page { max-width: 1680px; margin: 0 auto; padding: 32px 36px 48px; }
@media (max-width: 760px) { .page { padding: 22px 16px 40px; } }
.page-head { display: flex; align-items: center; gap: 18px; padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--lk-line); }
.page-title { flex: 1; min-width: 0; }
.page-title h1 { font: 700 32px/1.1 'Gilroy', sans-serif; letter-spacing: -.8px; color: var(--lk-fg); }
.page-title h1::after { content: '.'; color: var(--lk-accent); }
.page-title p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--lk-muted); }
.page-end { display: flex; align-items: center; gap: 10px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .page-head { flex-wrap: wrap; } .page-end { width: 100%; justify-content: flex-start; } }

.icon-tile { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px; color: var(--lk-accent); background: var(--lk-tint); }
.icon-tile .lk-icon { width: 15px; height: 15px; }
.icon-tile.is-good { color: var(--lk-good); background: color-mix(in srgb, var(--lk-good) 14%, var(--lk-panel)); }
.icon-tile.is-bad  { color: var(--lk-bad);  background: color-mix(in srgb, var(--lk-bad) 14%, var(--lk-panel)); }
.icon-tile.is-amber { color: var(--lk-amber); background: color-mix(in srgb, var(--lk-amber) 16%, var(--lk-panel)); }
.icon-tile.is-lg { width: 44px; height: 44px; border-radius: 14px; } .icon-tile.is-lg .lk-icon { width: 20px; height: 20px; }
.icon-tile.is-head { width: 60px; height: 60px; border-radius: 18px; } .icon-tile.is-head .lk-icon { width: 24px; height: 24px; }

.live-box { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 12px; background: var(--lk-panel);
  box-shadow: inset 0 0 0 1px var(--lk-line); font-size: 13px; font-weight: 600; color: var(--lk-fg); font-variant-numeric: tabular-nums; }
.lk-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--lk-slate)); flex: none; }
.lk-dot.is-good { --c: var(--lk-good); } .lk-dot.is-bad { --c: var(--lk-bad); } .lk-dot.is-amber { --c: var(--lk-amber); }
.lk-dot.is-live { animation: lk-pulse 2.4s var(--lq-ease) infinite; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; border: 1px solid transparent;
  border-radius: var(--lq-radius-xs); font: 700 13.5px/1.2 'Gilroy', sans-serif; letter-spacing: -.1px; white-space: nowrap; cursor: pointer; user-select: none;
  transition: transform var(--lq-base) var(--lq-spring), background-color var(--lq-fast) var(--lq-ease), border-color var(--lq-fast) var(--lq-ease),
    color var(--lq-fast) var(--lq-ease), box-shadow var(--lq-base) var(--lq-ease), opacity var(--lq-fast); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.975); transition-duration: 80ms; }
.btn .lk-icon { width: 16px; height: 16px; }
.btn-small { min-height: 36px; padding: 7px 14px; font-size: 12.5px; border-radius: 11px; }
.btn-primary { background: var(--lq-accent); color: var(--lq-accent-ink); box-shadow: 0 1px 2px #1d104018, 0 8px 20px -8px color-mix(in srgb, var(--lq-accent-deep) 55%, transparent); }
.btn-primary:hover { background: var(--lq-accent-strong); box-shadow: 0 2px 4px #1d104020, 0 14px 28px -10px color-mix(in srgb, var(--lq-accent-deep) 70%, transparent); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border-color: color-mix(in srgb, var(--lq-accent) 18%, var(--lq-line)); }
.btn-secondary:hover { background: var(--bg-hover-accent); border-color: color-mix(in srgb, var(--lq-accent) 42%, var(--lq-line)); }
.btn[aria-busy=true] { cursor: progress; opacity: .8; }
.btn[aria-busy=true] .lk-icon { animation: spin 1s linear infinite; }

/* Bands and card rows (every row fills) */
.band { display: grid; gap: 12px; }
.band + .band { margin-top: 26px; }
.band-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: 0 2px; font: 700 15px/1.3 'Gilroy', sans-serif; letter-spacing: -.01em; color: var(--lk-fg); }
.band-title > span { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--lk-muted); }
.band-title > .count { margin-left: auto; }
.count { padding: 4px 9px; border-radius: 999px; background: color-mix(in srgb, var(--text-primary) 6%, transparent); font: 700 11.5px/1 'Gilroy', sans-serif;
  font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.split { display: grid; gap: 14px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: stretch; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* Card */
.card { position: relative; padding: 22px; border-radius: var(--lq-radius); background: var(--bg-card); border: 1px solid var(--lq-line); box-shadow: var(--lq-shadow-rest); min-width: 0;
  animation: lk-in .45s var(--lq-ease) both; }

/* Kit card */
.kcard { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; padding: 16px 18px 14px; border-radius: var(--lk-r); background: var(--lk-panel);
  box-shadow: inset 0 0 0 1px var(--lk-line), var(--lk-shadow); animation: lk-in .45s var(--lq-ease) both; animation-delay: calc(var(--d, 0) * 45ms); }
html.light .kcard { box-shadow: 0 0 0 1px var(--lk-line), var(--lk-shadow); }
.kcard.is-pad { padding: 22px 24px 20px; }
.kcard-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.kcard-label { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 12.5px; font-weight: 650; letter-spacing: 0; color: var(--lk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard-title { flex: 1 1 auto; min-width: 0; margin: 0; font: 700 16px/1.3 'Gilroy', sans-serif; letter-spacing: -.2px; color: var(--lk-fg); }
.kcard-title small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--lk-muted); }
.kcard-now { display: grid; gap: 3px; margin: 8px 0 12px; min-width: 0; }
.figure { margin: 0; font: 700 31px/1.05 'Gilroy', sans-serif; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--lk-fg); overflow: hidden; text-overflow: ellipsis; }
.figure.is-sm { font-size: 24px; }
.figure.is-accent { color: var(--lk-accent); } html:not(.light) .figure.is-accent { color: #c9a8ff; }
.figure small { margin-left: 6px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--lk-muted); }
.figure.is-none { color: var(--lk-faint); }
.kcard-context { display: block; min-height: 17px; margin: 0; font-size: 12px; line-height: 1.4; color: var(--lk-muted); }
.kcard-context b { color: var(--lk-fg); font-weight: 650; }
.kcard-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 1px 10px; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--lk-line); }
.kcard-foot + .kcard-foot { margin-top: 0; padding-top: 7px; border-top: 0; }
.kcard-foot > span { font-size: 11.5px; font-weight: 600; color: var(--lk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard-foot > strong { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; color: var(--lk-fg); }
.kcard-foot > small { grid-column: 1 / -1; font-size: 11px; line-height: 1.35; color: var(--lk-muted); text-align: right; }
.kcard .btn { margin-top: 14px; align-self: flex-start; }

/* Status chip: the quiet chip with a meaning dot */
.status { --c: var(--lq-slate); display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 0; border-radius: 999px;
  font: 600 12px/1.2 'Gilroy', sans-serif; letter-spacing: .1px; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 11%, transparent); color: color-mix(in srgb, var(--c) 72%, var(--text-primary)); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.status.is-good { --c: var(--lq-good); } .status.is-amber { --c: var(--lq-amber); } .status.is-bad { --c: var(--lq-bad); }
.status.is-blue { --c: var(--lq-blue); } .status.is-live { --c: var(--lq-accent); }

/* Table (lives inside a card) */
.table-wrap { min-width: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { padding: 0 12px 10px; text-align: left; font-size: 11.5px; font-weight: 650; color: var(--lk-muted); white-space: nowrap; border-bottom: 1px solid var(--lk-line); }
.table td { padding: 11px 12px; color: var(--lk-fg); border-bottom: 1px solid var(--lk-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table :is(th, td).num { text-align: right; }
.table :is(th, td):first-child { padding-left: 4px; } .table :is(th, td):last-child { padding-right: 4px; }
.table tbody tr { transition: background-color var(--lq-fast); }
.table tbody tr[data-id] { cursor: pointer; }
.table tbody tr[data-id]:hover td, .table tbody tr.is-selected td { background: var(--lk-hover); }
.table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--lk-accent); }
.table td b { font-weight: 650; }
.table td .sub { display: block; font-size: 12px; color: var(--lk-muted); }

.note { display: flex; align-items: center; gap: 8px; margin: 14px 2px 0; font-size: 12px; line-height: 1.4; color: var(--lk-muted); }
.note .lk-icon { width: 15px; height: 15px; }

/* Customer detail: label / value list on hairlines */
.detail { display: flex; flex-direction: column; }
.detail-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--lq-line); }
.detail-head h3 { font: 700 17px/1.3 'Gilroy', sans-serif; letter-spacing: -.3px; color: var(--lk-fg); }
.detail-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--lk-muted); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin: 18px 0 0; }
.kv dt { margin: 0 0 4px; font-size: 12.5px; line-height: 1.4; color: var(--text-tertiary); }
.kv dd { margin: 0; font: 600 15px/1.4 'Gilroy', sans-serif; color: var(--text-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv .is-wide { grid-column: 1 / -1; }

.detail-foot { margin-top: auto; padding-top: 22px; }
.detail-foot .kcard-foot:first-child { margin-top: 0; }

/* Login permissions: a short list on hairlines */
.perm-title { margin: 6px 0 4px; font-size: 11.5px; font-weight: 650; letter-spacing: 0; color: var(--lk-muted); }
.perm { list-style: none; margin: 0 0 14px; padding: 0; }
.perm li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--lq-line-soft); font-size: 13px; color: var(--lk-fg); }
.perm li:first-child { border-top: 0; }

/* Security rows on hairlines */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-top: 1px solid var(--lq-line-soft); min-height: 30px; }
.row:first-child { border-top: 0; padding-top: 2px; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-main b { font-size: 13.5px; font-weight: 650; color: var(--lk-fg); }
.row-main span { font-size: 12px; line-height: 1.4; color: var(--lk-muted); overflow-wrap: anywhere; }
.row .status { flex: none; }

/* Skeleton */
.sk { display: inline-block; height: 11px; width: var(--w, 70%); max-width: 100%; border-radius: 6px; vertical-align: middle;
  background: var(--lq-line); animation: skel 1.4s ease-in-out infinite; }
.figure .sk { height: 26px; border-radius: 8px; }
.skel td { padding: 16px 12px; }

/* Toast and footer */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 90; max-width: 420px; padding: 14px 18px; border-radius: 18px; background: var(--bg-card);
  border: 1px solid var(--lq-line); box-shadow: var(--lq-shadow-pop); font-size: 13px; color: var(--text-primary); animation: lk-in .3s var(--lq-ease) both; }
.foot { margin: 34px 2px 0; font-size: 12px; color: var(--lk-muted); }

/* Motion: blocks rise in once */
@keyframes lk-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes lk-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c, var(--lk-good)) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@keyframes skel { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.is-settled .card, .is-settled .kcard { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
}
