:root {
  color-scheme: light;
  --yellow: #ffd900;
  --ink: #111827;
  --muted: #6b7280;
  --line: #dce2ec;
  --panel: #ffffff;
  --black: #101010;
  --blue: #254993;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0,0,0,.78), rgba(72,62,0,.72), rgba(255,217,0,.34)),
    url("./assets/pg_bg_dark.png") center top / cover fixed,
    #171717;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.auth-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid rgba(255, 217, 0, .75);
  border-bottom: 6px solid var(--yellow);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .30);
  padding: 28px;
}

.login-brand {
  display: grid;
  gap: 7px;
  margin: -28px -28px 24px;
  padding: 24px 28px 26px;
  border-radius: 17px 17px 0 0;
  background: #101722;
  color: #fff;
}

.login-brand span {
  color: var(--yellow);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.login-brand strong {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1;
  font-weight: 950;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.1;
}

.login-card p {
  margin: 0 0 20px;
  color: #1f2937;
  font-size: 18px;
  font-weight: 700;
}

.login-card label {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  color: #374151;
  font-size: 15px;
  font-weight: 900;
}

.login-card input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  padding: 10px 14px;
  font-size: 18px;
  font-weight: 850;
  outline: none;
}

.login-card input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}

.login-card button {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: #111827;
  font-size: 18px;
  font-weight: 950;
}

.login-card button.create-account {
  border: 2px solid var(--yellow);
  background: #101722;
  color: #fff;
}

.login-card button.quiet-action {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--blue);
  font-size: 15px;
}

.error {
  min-height: 24px;
  margin-top: 14px;
  color: #c81e1e;
  font-size: 15px;
  font-weight: 900;
}

.dashboard-frame-shell {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: #111;
  height: 100vh;
  height: 100dvh;
}

.dashboard-frame-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}

.app-shell-tools {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

body.bg-admin-controls-relocated .app-shell-tools {
  display: none;
}

.app-role-badge {
  pointer-events: auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: rgba(16, 23, 34, .82);
  color: #fff;
  padding: 8px 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  font-size: 13px;
  font-weight: 950;
}

.app-tool-pill {
  pointer-events: auto;
  min-height: 42px;
  border: 2px solid rgba(255, 217, 0, .95);
  border-radius: 999px;
  background: #101722;
  color: var(--yellow);
  padding: 8px 18px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .30);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.app-tool-pill-muted {
  border-color: rgba(255, 255, 255, .42);
  color: #fff;
}

.admin-only[hidden] {
  display: none !important;
}

.hub-divider {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, .32);
  margin: 22px 0;
}

body.bg-customer-preview-active .app-role-badge {
  color: var(--yellow);
}

.data-hub-panel {
  position: fixed;
  z-index: 25;
  right: 18px;
  bottom: 72px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px - env(safe-area-inset-top));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  overflow: auto;
  border: 1px solid rgba(255, 217, 0, .84);
  border-top: 8px solid var(--yellow);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  color: #111827;
  box-shadow: 0 20px 58px rgba(0, 0, 0, .46);
}

.data-hub-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px;
  background: #101722;
  color: #fff;
}

.data-hub-head span,
.data-hub-section h2 {
  color: var(--yellow);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .20em;
  text-transform: uppercase;
}

.data-hub-head strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.data-hub-head button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.data-hub-section {
  padding: 18px 22px 22px;
  border-top: 1px solid #e5e7eb;
}

.data-hub-section:first-of-type {
  border-top: 0;
}

.data-hub-section h2 {
  margin: 0 0 8px;
}

.data-hub-section h3 {
  margin: 14px 0 8px;
  color: var(--yellow);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.data-hub-section p {
  margin: 0 0 14px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.file-pick {
  display: block;
  margin: 0 0 12px;
}

.file-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-pick span,
#nativeImportBtn,
#grantCustomerBtn {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: #111827;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 950;
}

#nativeImportBtn,
#grantCustomerBtn {
  margin: 0 0 12px;
}

#nativeImportBtn:disabled,
#grantCustomerBtn:disabled {
  background: #e5e7eb;
  color: #6b7280;
}

.hub-field {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  color: #374151;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.hub-field input,
.hub-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 850;
  text-transform: none;
  letter-spacing: 0;
}

.hub-status {
  min-height: 34px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #374151;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.hub-status.hub-ok {
  border-color: rgba(22, 163, 74, .36);
  background: #ecfdf5;
  color: #166534;
}

.hub-status.hub-error {
  border-color: rgba(220, 38, 38, .36);
  background: #fef2f2;
  color: #b91c1c;
}

.native-shop-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  color: #4b5563;
  font-size: 14px;
  font-weight: 850;
}

.native-shop-row {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 12px;
}

.native-shop-row strong {
  display: block;
  color: #111827;
}

.pending-customer-row {
  display: grid;
  gap: 5px;
}

.pending-customer-row span,
.pending-customer-row small {
  color: #4b5563;
}

.pending-customer-row button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: #111827;
  color: #ffd400;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.app-tool-pill.has-pending {
  color: #111827;
  background: var(--yellow);
  border-color: var(--yellow);
}

body.bg-customer-preview-active::before {
  content: "CUSTOMER VIEW PREVIEW";
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 25;
  border: 2px solid var(--yellow);
  border-radius: 999px;
  background: rgba(15, 23, 42, .94);
  color: var(--yellow);
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  pointer-events: none;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .32);
}

.catalog-update-dialog{position:fixed;inset:0;z-index:80;display:grid;place-items:center;background:rgba(2,6,23,.74);padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}.catalog-update-dialog[hidden]{display:none}.catalog-update-panel{width:min(620px,100%);max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;border:2px solid var(--yellow);border-radius:8px;background:#fff;padding:20px;box-shadow:0 24px 70px rgba(0,0,0,.38)}
.catalog-update-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.catalog-update-head span{color:#6b7280;font-size:11px;font-weight:950;text-transform:uppercase}.catalog-update-head h2{margin:3px 0 0;font-size:22px;letter-spacing:0}.catalog-update-head button{width:34px;height:34px;border:0;border-radius:5px;background:#111827;color:#fff;font-size:24px;line-height:1;cursor:pointer}.catalog-update-panel>p{color:#4b5563;font-size:14px;font-weight:700;line-height:1.45}.catalog-source-link{display:inline-flex;border-radius:5px;background:#111827;color:var(--yellow);padding:9px 12px;font-size:13px;font-weight:950;text-decoration:none}
.catalog-file-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.catalog-file-grid label{display:grid;gap:7px;border:1px solid #cbd5e1;border-radius:7px;background:#f8fafc;padding:12px;color:#374151;font-size:12px;font-weight:950}.catalog-file-grid input{position:absolute;width:1px;height:1px;opacity:0}.catalog-file-grid span{display:flex;min-height:42px;align-items:center;justify-content:center;border:1px dashed #94a3b8;border-radius:5px;background:#fff;color:#111827;padding:8px;text-align:center;cursor:pointer}
#catalogUpdateStart,#fluidUpdateStart{width:100%;min-height:46px;border:0;border-radius:5px;background:var(--yellow);color:#111827;font-size:14px;font-weight:950;cursor:pointer}#catalogUpdateStart:disabled,#fluidUpdateStart:disabled{background:#e5e7eb;color:#6b7280;cursor:default}.catalog-update-progress{margin-top:16px;border:1px solid #d8dee8;border-radius:7px;padding:13px}.catalog-progress-track{height:8px;overflow:hidden;border-radius:4px;background:#e5e7eb}.catalog-progress-track i{display:block;width:0;height:100%;background:#16a34a;transition:width .25s ease}.catalog-update-progress strong,.catalog-update-progress span{display:block}.catalog-update-progress strong{margin-top:10px;color:#111827}.catalog-update-progress span{margin-top:3px;color:#64748b;font-size:12px;font-weight:750}.catalog-update-result{margin-top:12px;color:#166534;font-size:13px;font-weight:850}.catalog-update-result.is-error{color:#b91c1c}

@media (max-width: 720px) {
  .auth-stage {
    place-items: start center;
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .login-card {
    width: 100%;
    padding: 22px;
  }

  .login-brand {
    margin: -22px -22px 20px;
    padding: 20px 22px 22px;
  }

  .login-brand span {
    font-size: 11px;
  }

  .login-brand strong {
    font-size: 32px;
  }

  .app-shell-tools { display: none !important; }

  .data-hub-panel {z-index:90;inset:0;width:100%;max-height:100dvh;border:0;border-radius:0;padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));box-sizing:border-box;background:#fff}
  .data-hub-head{position:sticky;top:calc(-1 * max(14px,env(safe-area-inset-top)));z-index:2;background:#111827;margin:calc(-1 * max(14px,env(safe-area-inset-top))) calc(-1 * max(14px,env(safe-area-inset-right))) 14px calc(-1 * max(14px,env(safe-area-inset-left)));padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 14px max(14px,env(safe-area-inset-left))}
  .data-hub-head button{width:44px;height:44px;min-width:44px}
  body.bg-customer-preview-active::before{display:none!important}
  .catalog-file-grid{grid-template-columns:1fr}
  .catalog-update-dialog{padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
  .catalog-update-panel{max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding:16px}
}
