/* QR Sync console — login stage matched to upload desktop LoginPage. */

:root {
  --ink: #000000;
  --text: #f5f5f4;
  --muted: rgba(245, 245, 244, 0.52);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.72);
  --btn: #f5f5f4;
  --btn-text: #0a0a0c;
  --danger: #e07070;
  --ok: #6fcf97;
  --panel: #0c0c0e;
  --font: "Avenir Next", "Helvetica Neue", "PingFang SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ── Login stage ─────────────────────────────────────────── */
.login-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  animation: shellIn 700ms cubic-bezier(0.22, 1, 0.36, 1) 80ms forwards;
}
@keyframes shellIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
}

.login-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  pointer-events: none;
}

.login-left, .login-right {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.login-left {
  flex: 60;
  padding: 48px 28px 48px 72px;
  pointer-events: none;
}
.login-right {
  flex: 40;
  padding: 68px 72px 48px 108px;
  pointer-events: none;
  justify-content: center;
}

.login-divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.14) 20%,
    rgba(255,255,255,0.14) 80%,
    rgba(255,255,255,0) 100%
  );
}

.brand-lockup {
  max-width: 400px;
  padding: 8px 16px 16px 8px;
  position: relative;
}
.brand-lockup::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 220px; height: 80px;
  background: radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05), transparent 70%);
  pointer-events: none;
}
.product {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.8px;
  color: rgba(245,245,244,0.92);
}
.meta {
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.form-panel {
  width: 360px;
  max-width: 100%;
  pointer-events: auto;
}
.sign-in {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}
.sign-hint {
  margin: 10px 0 0;
  font-size: 14px;
  letter-spacing: 0.2px;
  color: var(--muted);
  line-height: 1.45;
}
.field-label {
  margin: 34px 0 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.8px;
  color: rgba(245,245,244,0.55);
}
.field-label + .field-label { margin-top: 22px; }
.field-label.spaced { margin-top: 22px; }

.login-input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  outline: none;
  border-radius: 10px;
  transition: border-color 140ms ease, background 140ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.login-input::placeholder { color: rgba(255,255,255,0.28); }
.login-input:focus {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
}
/* Chrome autofill paints a harsh white box — keep it on-theme + rounded. */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  box-shadow: 0 0 0 1000px #12141a inset;
  transition: background-color 99999s ease-out;
}

.status {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.status.error { color: var(--danger); }

.btn-continue {
  margin-top: 18px;
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--btn);
  color: var(--btn-text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn-continue:hover { background: #fff; }
.btn-continue:disabled {
  background: #3a3a40;
  color: #8a8a90;
  cursor: default;
}

.footer {
  margin-top: 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: rgba(245,245,244,0.4);
}

.bgm-toggle {
  position: absolute;
  left: 72px;
  bottom: 48px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(20,20,24,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  display: grid;
  place-items: center;
  padding: 0;
}
.bgm-toggle:hover { border-color: rgba(255,255,255,0.32); }
.bgm-toggle svg { width: 18px; height: 18px; display: block; }

@media (max-width: 900px) {
  .login-overlay { flex-direction: column; }
  .login-left { display: none; }
  .login-divider { display: none; }
  .login-right {
    flex: 1;
    padding: 48px 28px;
    justify-content: flex-end;
    padding-bottom: 96px;
  }
  .form-panel { width: 100%; }
  .bgm-toggle { left: 24px; bottom: 24px; }
  .sign-in { font-size: 28px; }
}

/* ── Vendors portal (full-bleed workspace) ───────────────── */
.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 640px at 6% -12%, rgba(255,255,255,0.05), transparent 52%),
    linear-gradient(168deg, #060708 0%, #0c0e12 46%, #070809 100%);
}
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35);
  flex-shrink: 0;
}
.app-bar-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}
.app-bar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.app-bar-sep {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.app-bar-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.app-bar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.app-bar .who {
  font-size: 13px;
  color: var(--muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-bar button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.app-bar button:hover { border-color: rgba(255,255,255,0.4); }

.app-main {
  width: 100%;
  flex: 1;
  margin: 0;
  padding: 28px 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

.panel {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(8,9,11,0.72);
}

.create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.create-block {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.create-block + .create-block {
  border-left: 1px solid rgba(255,255,255,0.08);
}
.create-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.toolbar-panel {
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}
.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.toolbar input {
  width: min(360px, 56vw);
  min-width: 220px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  color: #fff;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.toolbar input:focus { border-color: rgba(255,255,255,0.42); }
.toolbar select {
  min-width: 180px;
  height: 42px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  color: #fff;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.toolbar select:focus { border-color: rgba(255,255,255,0.42); }
.toolbar select option { background: #12141a; color: #fff; }
.toolbar-field.grow { flex: 1; min-width: 180px; }
.toolbar-field.grow input { width: 100%; min-width: 0; }
.toolbar-software { width: 100%; align-items: end; }
.toolbar .btn-primary {
  height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: 9px;
  background: var(--btn);
  color: var(--btn-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.toolbar .btn-primary:hover { background: #fff; }
.toolbar-hint {
  margin: 0;
  font-size: 12px;
  color: rgba(245,245,244,0.38);
  max-width: 360px;
  line-height: 1.45;
}

.flash {
  display: none;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}
.flash.show { display: block; }
.flash strong { color: #fff; }
.flash.warn { border-color: rgba(224,112,112,0.45); color: #f0c0c0; }

.table-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.table-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.vendors-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13.5px;
}
.vendors-table .col-dir-company { width: 16%; }
.vendors-table .col-dir-mp { width: 22%; }
.vendors-table .col-dir-sw { width: 46%; }
.vendors-table .col-dir-tier { width: 16%; }

.vendors-table .col-vendor { width: 26%; }
.vendors-table .col-prefix { width: 28%; }
.vendors-table .col-status { width: 16%; }
.vendors-table .col-created { width: 30%; }

.vendors-table th,
.vendors-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: middle;
}
.vendors-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.2px;
  color: var(--muted);
  font-weight: 500;
  background: #101217;
  border-bottom-color: rgba(255,255,255,0.1);
}
.vendors-table tbody tr:hover td {
  background: rgba(255,255,255,0.025);
}
.vendors-table tbody tr:last-child td { border-bottom: none; }

.cell-vendor {
  font-weight: 600;
  letter-spacing: 0.15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cell-time {
  color: rgba(245,245,244,0.78);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.th-actions,
.td-actions {
  text-align: right;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.key-chip-wide {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.cell-sw-key { overflow: hidden; }
.cell-note {
  color: rgba(245,245,244,0.62);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.muted-dash { color: rgba(245,245,244,0.28); }
.tier {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.3px;
  background: rgba(255,255,255,0.06);
  color: rgba(245,245,244,0.72);
  white-space: nowrap;
}
.tier-ok { background: rgba(111,207,151,0.14); color: var(--ok); }
.tier-wait { background: rgba(230,180,90,0.14); color: #e0b45a; }
.tier-admin { background: rgba(140,170,255,0.16); color: #9bb0ff; }

.software-table .col-sw-company { width: 22%; }
.software-table .col-sw-key { width: 58%; }
.software-table .col-sw-tier { width: 20%; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.35px;
  white-space: nowrap;
}
.badge.on { background: rgba(111,207,151,0.15); color: var(--ok); }
.badge.off { background: rgba(255,255,255,0.06); color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.row-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.row-actions button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text);
  border-radius: 7px;
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.row-actions button:hover { border-color: rgba(255,255,255,0.4); }
.row-actions button.danger { color: #f0a0a0; border-color: rgba(224,112,112,0.35); }

.empty {
  padding: 56px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  width: min(560px, 100%);
  background: #101217;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: #fff; }
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}
.modal-body .toolbar-field input,
.modal-body .toolbar-field select {
  width: 100%;
  min-width: 0;
}
.modal-body input.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}
.btn-ghost {
  height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.16);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.4); }
.modal-foot .btn-primary { height: 40px; }

@media (max-width: 960px) {
  .app-bar,
  .app-main { padding-left: 20px; padding-right: 20px; }
  .create-grid { grid-template-columns: 1fr; }
  .create-block + .create-block {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .directory-table { min-width: 860px; }
}
