:root {
  color-scheme: light;
  --ink: #16212a;
  --muted: #617080;
  --line: #d8e1e7;
  --surface: #ffffff;
  --soft: #f4f7f5;
  --green: #0f7a5f;
  --green-dark: #07513f;
  --blue: #1f6fb2;
  --yellow: #f2b84b;
  --red: #b33131;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef5f1 0%, #f7f8fb 45%, #edf4f8 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.1fr) minmax(260px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.lead-panel,
.form-panel,
.sales-panel > * {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(35, 55, 73, 0.08);
}

.lead-panel {
  overflow: hidden;
}

.brand-row {
  display: flex;
  gap: 14px;
  padding: 24px;
  align-items: flex-start;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 800;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.06;
  margin-bottom: 0;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.hero-media {
  min-height: 310px;
  position: relative;
  background:
    radial-gradient(circle at 78% 22%, rgba(242, 184, 75, 0.55), transparent 24%),
    linear-gradient(160deg, #dfece3, #e9f2f7);
  overflow: hidden;
}

.sun {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: var(--yellow);
  right: 34px;
  top: 28px;
}

.panel-grid {
  position: absolute;
  left: 28px;
  right: 48px;
  bottom: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  transform: perspective(420px) rotateX(54deg) rotateZ(-8deg);
  transform-origin: bottom center;
}

.panel-grid span {
  aspect-ratio: 1.4 / 1;
  background: linear-gradient(145deg, #154e78, #2d8ccd);
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(14, 36, 61, 0.18);
}

.meter-card {
  position: absolute;
  left: 24px;
  bottom: 22px;
  width: 150px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(18, 58, 82, 0.13);
  border-radius: 8px;
}

.meter-card strong {
  display: block;
  font-size: 1.7rem;
}

.meter-card span,
.form-header p,
.privacy-note,
.file-name,
.upload-card small {
  color: var(--muted);
}

.trust-strip {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.trust-strip span {
  padding: 14px 18px;
  background: #fff;
  font-weight: 700;
  font-size: 0.92rem;
}

.form-panel {
  padding: 24px;
}

.form-header p {
  line-height: 1.5;
  margin-bottom: 20px;
}

.field-grid,
.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label,
legend {
  display: grid;
  gap: 7px;
  color: #263846;
  font-size: 0.91rem;
  font-weight: 750;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input:not([type]) {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfd;
}

input:focus {
  outline: 3px solid rgba(31, 111, 178, 0.16);
  border-color: var(--blue);
}

fieldset {
  border: 0;
  padding: 20px 0 0;
  margin: 0;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fbfcfd;
}

.upload-grid {
  margin-top: 16px;
}

.upload-card {
  min-height: 150px;
  border: 1.5px dashed #aebdc7;
  border-radius: 8px;
  padding: 16px;
  align-content: start;
  cursor: pointer;
  background: var(--soft);
}

.upload-card input {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
}

.upload-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: 1.35rem;
  line-height: 1;
}

.file-name {
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 10px;
  line-height: 1.4;
  font-weight: 650;
}

.form-error {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--red);
  font-weight: 750;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 6px;
  min-height: 46px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  background: var(--green);
  color: #fff;
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button,
.icon-button {
  background: #eaf1f5;
  color: var(--ink);
}

.privacy-note {
  margin: 12px 0 0;
  line-height: 1.45;
  font-size: 0.83rem;
}

.success-state {
  min-height: 430px;
  display: grid;
  place-items: center;
  text-align: center;
  align-content: center;
  gap: 12px;
}

.success-state p {
  color: var(--muted);
  max-width: 360px;
  line-height: 1.5;
}

.success-icon {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-size: 2rem;
}

.sales-panel {
  display: grid;
  gap: 18px;
}

.qr-card,
.lead-list {
  padding: 18px;
}

.qr-card {
  display: grid;
  gap: 14px;
}

#qrImage {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.icon-button {
  min-width: 50px;
}

.lead-items {
  display: grid;
  gap: 10px;
}

.admin-token-field {
  margin: 12px 0;
}

.lead-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.lead-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.lead-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.file-download {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.admin-body {
  background: #eef3f6;
}

.workspace-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.workspace-sidebar {
  background: #13232e;
  color: #fff;
  padding: 22px;
}

.workspace-sidebar .brand-mark {
  background: var(--green);
}

.workspace-sidebar .eyebrow {
  color: #80d6bd;
}

.brand-row.compact {
  padding: 0;
}

.brand-row.compact h1 {
  font-size: 1.55rem;
}

.workspace-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav-link,
.text-link {
  color: inherit;
  text-decoration: none;
}

.nav-link {
  padding: 11px 12px;
  border-radius: 6px;
  color: #d7e2e8;
  font-weight: 800;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.workspace-main {
  padding: 24px;
}

.workspace-login {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.login-panel,
.workspace-header,
.metric-card,
.request-list-panel,
.request-detail,
.workspace-qr {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(35, 55, 73, 0.08);
}

.login-panel {
  width: min(100%, 430px);
  padding: 24px;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.workspace-header h2 {
  margin-bottom: 0;
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.metric-card {
  padding: 16px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.request-list-panel,
.request-detail,
.workspace-qr {
  padding: 16px;
}

.panel-toolbar {
  margin-bottom: 12px;
}

.request-list {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
}

.request-row {
  width: 100%;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.request-row.active {
  border-color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}

.request-row span,
.request-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-pill {
  border-radius: 999px;
  background: #e4f4ee;
  color: var(--green-dark);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-list a {
  color: var(--blue);
  font-weight: 800;
}

.file-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.file-box {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.file-box span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-box.muted {
  cursor: default;
  opacity: 0.68;
}

.workspace-qr {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.qr-export-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.qr-export-row img {
  width: 180px;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.qr-actions {
  display: grid;
  gap: 9px;
  justify-items: start;
}

.text-link {
  color: var(--blue);
  font-weight: 850;
}

.empty-state {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sales-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-shell,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 520px);
    padding: 10px 0;
  }

  .brand-row,
  .form-panel,
  .qr-card,
  .lead-list {
    padding: 16px;
  }

  .field-grid,
  .upload-grid,
  .choice-row,
  .sales-panel,
  .metric-grid,
  .file-actions,
  .qr-export-row {
    grid-template-columns: 1fr;
  }

  .workspace-main,
  .workspace-sidebar {
    padding: 14px;
  }

  .workspace-header,
  .detail-header {
    display: grid;
  }

  .hero-media {
    min-height: 230px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .lead-panel,
  .form-panel,
  .lead-list {
    display: none;
  }

  .app-shell {
    display: block;
    width: 100%;
  }

  .qr-card {
    box-shadow: none;
    border: 0;
  }
}
