:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --bg-deep: #111318;
  --ink: #171a21;
  --muted: #667085;
  --soft: #8b94a6;
  --line: #dde2ea;
  --line-strong: #c7ceda;
  --panel: #ffffff;
  --panel-soft: #f9fafc;
  --accent: #e6002d;
  --accent-dark: #a90022;
  --accent-soft: #fff0f3;
  --ok: #147348;
  --ok-soft: #e7f6ee;
  --warn: #9a5b00;
  --warn-soft: #fff4de;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 18px 42px rgba(17, 19, 24, 0.10);
  --shadow-soft: 0 10px 28px rgba(17, 19, 24, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -8%, rgba(230, 0, 45, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff 0, var(--bg) 360px, #eef1f5 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; }

.topbar {
  background: rgba(17, 19, 24, 0.96);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.topbar-inner {
  min-height: 72px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand strong { display: block; font-size: 16px; line-height: 1.1; }
.brand small { display: block; color: #b8beca; font-size: 12px; margin-top: 3px; }

.mark, .mini-mark {
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff4a66);
  color: #fff;
  border-radius: 7px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 10px 24px rgba(230, 0, 45, .28);
}
.mark { width: 42px; height: 42px; font-size: 13px; }
.mini-mark { width: 44px; height: 44px; font-size: 13px; }

nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
nav a {
  text-decoration: none;
  color: #eef1f6;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 800;
}
nav a:hover { background: rgba(255,255,255,.12); }

.shell { max-width: 1240px; margin: 0 auto; padding: 30px 28px 44px; }

.hero, .page-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 24px 0 22px;
}

.stamp {
  display: inline-flex;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}

h1, h2 { margin: 0; line-height: 1.08; letter-spacing: 0; }
h1 { font-size: 40px; max-width: 760px; }
h2 { font-size: 22px; }
p { line-height: 1.56; }
.hero p, .page-head p, .lead, .section-title p { color: var(--muted); max-width: 760px; font-size: 16px; margin-bottom: 0; }

.panel {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 24px;
  margin: 0 0 22px;
}

.panel.narrow { max-width: 520px; margin: 46px auto; }
.panel.customer { max-width: 620px; margin: 0; }

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 4px;
}
.section-title p { margin-top: 8px; }

.notice, .warn, .ok, .setup-card {
  border-radius: 8px;
  padding: 13px 15px;
  font-weight: 800;
}
.notice { background: #fff8e6; border: 1px solid #f0d37a; margin: 0 0 18px; color: #6f4a00; }
.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f2ce88; }
.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #aadabd; }

.setup-card {
  width: min(360px, 100%);
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #f2ce88;
  box-shadow: var(--shadow-soft);
}
.setup-card.ready { background: var(--ok-soft); color: var(--ok); border-color: #aadabd; }
.setup-card strong, .setup-card span { display: block; }
.setup-card span { margin-top: 4px; color: inherit; opacity: .86; font-size: 13px; line-height: 1.45; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}
.metric-strip div {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.metric-strip span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.metric-strip strong { display: block; font-size: 30px; margin-top: 5px; }

.form { display: grid; gap: 14px; margin-top: 18px; }
.form.grid, .form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #333947; font-weight: 900; font-size: 13px; }
input, textarea {
  width: 100%;
  border: 1px solid #c9ced8;
  border-radius: 7px;
  padding: 12px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, textarea:focus {
  border-color: rgba(230,0,45,.56);
  box-shadow: 0 0 0 4px rgba(230,0,45,.10);
}
input[readonly] { color: var(--muted); background: var(--panel-soft); }
textarea { resize: vertical; }
.wide { grid-column: 1 / -1; }

.button, button {
  appearance: none;
  border: 1px solid #c8ced8;
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  min-height: 38px;
  padding: 9px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.button:hover, button:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.button.primary {
  background: linear-gradient(135deg, var(--accent), #f63a57);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 12px 26px rgba(230, 0, 45, .24);
}
.button.primary:hover { background: linear-gradient(135deg, var(--accent-dark), var(--accent)); }
button.success { color: var(--ok); border-color: #b8d9c7; background: #f3fbf6; }
button.danger { color: var(--danger); border-color: #f1b8b2; background: var(--danger-soft); }
.button.wide { width: 100%; margin-top: 20px; min-height: 50px; }
.create-panel .button.primary { width: min(260px, 100%); }

.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 1060px; background: #fff; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 14px 12px; vertical-align: top; }
tbody tr:hover { background: #fafbfc; }
th { color: #4d5563; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; }
td strong { font-weight: 900; }
td small { display: block; color: var(--muted); margin-top: 5px; line-height: 1.35; }
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  background: #edf0f4;
  color: #495160;
}
.status.good { background: var(--ok-soft); color: var(--ok); }
.status.done { background: #eef2ff; color: #3440a0; }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.neutral { background: #f0f2f5; color: #5b6472; }
.status.draft { background: var(--accent-soft); color: var(--accent-dark); }
.link {
  display: block;
  max-width: 280px;
  word-break: break-all;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}
.actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 250px; }
.actions form { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 34px; }

.summary {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px 16px;
  border: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 8px;
  padding: 17px;
  margin-top: 20px;
}
.summary span { color: var(--muted); font-weight: 800; }
.summary strong { color: var(--ink); }
.fineprint { color: var(--muted); font-size: 13px; }
.pill {
  display: inline-flex;
  background: var(--bg-deep);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 14px;
}

.login-wrap, .customer-wrap {
  min-height: calc(100vh - 132px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 34px;
  align-items: center;
}
.login-copy h1, .customer-intro h1 { max-width: 620px; }
.auth-panel { margin: 0; }

.customer-panel-head {
  display: flex;
  gap: 13px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.customer-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}
.checklist {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.checklist li {
  position: relative;
  padding-left: 25px;
  color: #343b49;
  line-height: 1.45;
  font-weight: 750;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .35em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

@media (max-width: 900px) {
  .hero, .page-head { display: block; }
  .setup-card { margin-top: 18px; }
  .metric-strip, .settings-grid, .login-wrap, .customer-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar-inner { padding: 12px 16px; align-items: flex-start; flex-direction: column; }
  nav { width: 100%; }
  nav a { flex: 1 1 auto; text-align: center; }
  .shell { padding: 20px 16px 34px; }
  h1 { font-size: 31px; }
  h2 { font-size: 21px; }
  .form.grid, .form.two { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .metric-strip strong { font-size: 26px; }
  .empty { text-align: left; }
}
