:root {
  color-scheme: light;
  --paper: #f7f5f1;
  --surface: #fff;
  --ink: #1f2329;
  --muted: #6e6a61;
  --line: #eae5dd;
  --orange: #f64800;
  --yellow: #ffdc00;
  --accent: #aa310b;
  --peach: #fff0e7;
  --green: #2c644a;
  --shadow: 0 8px 24px #35281708;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
a { color: var(--accent); }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #c94921; outline-offset: 3px; }
.skip-link { position: absolute; left: 15px; top: 12px; z-index: 5; padding: 8px 12px; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.brand strong { font-size: 16px; letter-spacing: .035em; }
.logo { display: grid; place-items: center; width: 87px; height: 45px; overflow: hidden; }
.logo img { width: 115px; max-width: none; grid-area: 1 / 1; justify-self: center; align-self: center; margin: -35px -14px; }
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 640px; margin: auto; min-height: 68px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-label { font-size: 13px; color: var(--muted); }

.public-page { max-width: 640px; margin: auto; padding: clamp(22px, 5vw, 54px) 22px 44px; }
.site-footer { padding: 0 16px 24px; text-align: center; font-size: 13px; }
.site-footer a { color: inherit; }
.brand-hero {
  isolation: isolate; position: relative; overflow: hidden; padding: clamp(20px, 5vw, 33px); margin-bottom: 14px;
  border: 1px solid #f5dcc7; border-radius: 19px;
  background: linear-gradient(113deg, #fff0e3 12%, #ffe9cf 65%, #fff1bc);
}
.brand-hero::after {
  content: ""; position: absolute; z-index: -1; top: -48px; right: -56px; width: 242px; height: 210px;
  border: 18px solid #f6480010; border-left-color: transparent; border-radius: 50%; transform: rotate(-32deg);
  box-shadow: 0 0 0 19px #fff5cf69;
}
h1 { font-size: clamp(27px, 4vw, 39px); letter-spacing: -.035em; line-height: 1.2; }
.intro p, .dashboard-head p, .receipt > p { color: var(--muted); margin-top: 8px; }
.brand-hero p { color: #675247; font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 15px; padding: clamp(18px, 5vw, 28px); }
.section-title { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 740; }
.section-title::before { content: ""; flex: none; width: 5px; height: 19px; border-radius: 5px; background: linear-gradient(var(--orange), var(--yellow)); }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
input:not([type="checkbox"]):not([type="hidden"]) {
  min-width: 0; width: 100%; color: var(--ink); background: #faf9f6; border: 1px solid #e3ded5;
  border-radius: 9px; padding: 10px 12px; min-height: 46px; font-size: 16px; font-weight: 400;
}
input::placeholder { color: #756e65; opacity: 1; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); cursor: pointer; }
.consent input { flex: none; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }
.button { padding: 10px 16px; min-height: 44px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; font-weight: 650; white-space: nowrap; }
.primary { border-radius: 999px; color: #fff; background: linear-gradient(115deg, #b83408, #a9360e); box-shadow: 0 5px 12px #b8340822; }
.primary:hover { background: #982b08; }
.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.secondary:hover { background: #f8f5ee; }
.small { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.error { color: #922a12; background: var(--peach); padding: 10px 12px; border-radius: 8px; font-size: 14px; }

.receipt { padding: 28px 22px; text-align: center; }
.receipt h1 { font-size: 28px; }
.receipt-mark { display: grid; place-items: center; margin: 0 auto 14px; width: 48px; height: 48px; border-radius: 50%; color: var(--green); background: #eaf4eb; font-weight: 800; font-size: 24px; }
.receipt .receipt-number { margin-top: 15px; padding: 10px; background: var(--paper); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.receipt-number strong, .record-id, .phone { font-variant-numeric: tabular-nums; }
.qr { margin: 22px auto 12px; }
.qr h2 { font-size: 16px; }
.qr img { display: block; margin: 8px auto; object-fit: contain; }
.qr p { color: var(--muted); font-size: 13px; }
.back { display: inline-block; margin-top: 12px; font-size: 14px; }

.app-shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 23px 16px; }
.sidebar .brand { margin: 0 0 23px 3px; }
.sidebar nav { display: grid; gap: 6px; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; min-height: 43px; border-radius: 9px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 630;
}
.side-link:hover { background: #f8f5f0; color: var(--ink); }
.side-link.current { color: var(--accent); background: var(--peach); }

.icon { display: inline-block; position: relative; width: 15px; height: 15px; flex: none; color: inherit; }
.icon-list { border: 1.5px solid currentColor; border-radius: 3px; width: 14px; height: 16px; }
.icon-list::after { content: ""; position: absolute; left: 3px; right: 3px; top: 4px; height: 1px; background: currentColor; box-shadow: 0 3px currentColor, 0 6px currentColor; }
.icon-clock { border: 1.5px solid currentColor; border-radius: 50%; width: 16px; height: 16px; }
.icon-clock::after { content: ""; position: absolute; left: 6px; top: 2px; width: 4px; height: 5px; border-left: 1.5px solid; border-bottom: 1.5px solid; }
.icon-check { width: 12px; height: 7px; border-bottom: 2px solid; border-left: 2px solid; transform: translateY(-1px) rotate(-45deg); }
.icon-external { border: 1.5px solid currentColor; border-radius: 3px; width: 13px; height: 13px; margin-right: 1px; }
.icon-external::before { content: ""; position: absolute; top: -3px; right: -3px; width: 7px; height: 7px; border-top: 1.5px solid; border-right: 1.5px solid; background: var(--surface); }
.icon-external::after { content: ""; position: absolute; top: 2px; right: -2px; width: 9px; height: 1.5px; background: currentColor; transform: rotate(-45deg); }

.workspace { width: 100%; max-width: 1480px; margin: 0 auto; padding: clamp(23px, 4vw, 48px) clamp(22px, 4vw, 52px) 48px; }
.dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dashboard-head p { font-size: 14px; }
.account { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.account-name { max-width: 150px; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 24px 0 20px; }
.metric { position: relative; min-width: 0; min-height: 112px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px 12px; box-shadow: var(--shadow); }
.metric dt { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric dd { margin-top: 4px; font-size: clamp(27px, 4vw, 38px); font-weight: 760; line-height: 1.17; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.metric-symbol { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 34px; height: 34px; color: #705645; border-radius: 10px; background: #f6f0e7; }
.metric.pending { background: #fffbf5; border-color: #f1d9c7; }
.metric.pending dd, .metric.pending .metric-symbol { color: var(--accent); }
.metric.pending .metric-symbol { background: #ffebdb; }
.metric.complete .metric-symbol { color: var(--green); background: #eaf4eb; }

.records { overflow: hidden; }
.records-head { padding: 18px 19px 0; }
.toolbar { padding: 12px 18px 15px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.tabs, .search { display: flex; align-items: center; gap: 6px; }
.tabs { background: #f6f3ed; padding: 3px; border-radius: 9px; }
.tab { padding: 6px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.tab.selected { color: var(--accent); background: #fff; box-shadow: 0 1px 4px #35281712; font-weight: 730; }
.search { width: min(100%, 310px); }
.search input[type="search"] { min-height: 36px; padding: 5px 9px; font-size: 14px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 13px 14px; text-align: left; border-top: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
th { font-size: 13px; font-weight: 650; color: #5e574e; background: #faf8f4; white-space: nowrap; }
tbody tr:hover { background: #fdfbf8; }
.record-id { display: block; color: var(--muted); font-size: 11px; }
.phone { white-space: nowrap; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.submitted { color: #98350e; background: var(--peach); }
.badge.contacted { color: var(--green); background: #eaf4eb; }
.muted { color: var(--muted); font-size: 13px; }
.empty { border-top: 1px solid var(--line); padding: 45px 18px 50px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-icon { display: grid; place-items: center; color: var(--accent); background: var(--peach); width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 12px; }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 5px; }
.pagination { display: flex; gap: 16px; justify-content: center; padding: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

@media (max-width: 940px) {
  .app-shell { grid-template-columns: 174px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .sidebar .brand { gap: 3px; margin-left: 0; }
  .sidebar .brand strong { font-size: 14px; }
  .workspace { padding-inline: 20px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { padding: 8px 15px 10px; border: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin: 0 0 5px; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .side-link { padding: 7px 10px; min-height: 36px; }
  .workspace { padding: 20px 14px 36px; }
  .dashboard-head { align-items: start; }
  .account { flex-direction: column; gap: 3px; align-items: end; max-width: 105px; }
  .metrics { gap: 7px; margin: 17px 0 14px; }
  .metric { min-height: 77px; padding: 9px; }
  .metric dd { font-size: 24px; }
  .metric-symbol { display: none; }
  .records-head { padding: 14px 12px 0; }
  .toolbar { padding: 10px 12px 12px; }
  .search { width: 100%; }
  table, tbody, tr { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { border-top: 1px solid var(--line); padding: 10px 12px; }
  td, td:first-child, td:last-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  td::before { content: attr(data-label); color: var(--muted); flex: none; font-size: 13px; }
  .lead-name, .lead-name:first-child { display: block; text-align: left; padding-bottom: 6px; }
  .lead-name::before { display: none; }
}

@media (max-width: 400px) {
  .public-page, .bar-inner { padding-inline: 14px; }
  .brand-hero { padding-inline: 17px; }
}
