/* FlowSale Ops panel. Plain CSS, no build step. Colours follow the design canvas. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; color: #111827; background: #F3F4F6; line-height: 1.45; }
a { color: #0F766E; }
code, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
h1, h2, h3 { margin: 0; }
input[type=checkbox], input[type=radio] { margin: 0; flex: 0 0 auto; width: 18px; height: 18px; accent-color: #0F766E; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: 0 0 232px; background: #0F172A; color: #E2E8F0; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 22px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: #14B8A6; color: #0F172A; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.brand-name { font-weight: 700; color: #FFFFFF; font-size: 15px; }
.brand-sub { font-size: 12px; color: #94A3B8; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; min-height: 38px; padding: 0 10px; border-radius: 8px; color: #E2E8F0; text-decoration: none; font-size: 14px; }
.nav a:hover { background: #1E293B; }
.nav a.on { background: #1E293B; color: #FFFFFF; font-weight: 600; }
.nav a.sub { padding-left: 22px; font-size: 13px; color: #94A3B8; min-height: 32px; }
.nav a.sub.on { color: #FFFFFF; }
.me { margin-top: auto; background: #1E293B; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.me-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: #334155; color: #FFFFFF; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.me-name { font-size: 13px; font-weight: 600; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 12px; color: #94A3B8; }
.me form button { width: 100%; height: 34px; border-radius: 8px; border: 1px solid #334155; background: transparent; color: #E2E8F0; cursor: pointer; font: inherit; font-size: 13px; }
.main { flex: 1 1 auto; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.crumb { font-size: 13px; color: #4B5563; margin-bottom: 4px; }
.crumb a { text-decoration: none; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-sub { margin: 4px 0 0; color: #4B5563; }

/* Cards and grids */
.card { background: #FFFFFF; border: 1px solid #E5E7EB; border-radius: 12px; }
.card-pad { padding: 20px 24px; }
.card-head { padding: 16px 24px; border-bottom: 1px solid #E5E7EB; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.card h2 { font-size: 16px; font-weight: 600; }
.grid { display: grid; gap: 16px; }
.grid-tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(420px, calc((100% - 24px) / 2))), 1fr)); gap: 24px; }
.tile { padding: 16px 18px; }
.tile-label { font-size: 13px; color: #4B5563; }
.tile-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.muted { color: #4B5563; }
.small { font-size: 12.5px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #4B5563; font-weight: 600; background: #F9FAFB; padding: 10px 16px; white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid #F1F2F4; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 24px; }
tr.link-row { cursor: pointer; }
tr.link-row:hover td { background: #F9FAFB; }

/* Badges */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-ok, .b-live, .b-succeeded { background: #CCFBF1; color: #115E59; }
.b-run, .b-onboarding, .b-running, .b-waiting { background: #DBEAFE; color: #1E40AF; }
.b-warn, .b-draft, .b-pending { background: #F3F4F6; color: #374151; }
.b-fail, .b-failed { background: #FEE2E2; color: #991B1B; }
.b-ent { background: #EDE9FE; color: #5B21B6; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid #D1D5DB; background: #FFFFFF; color: #111827; font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { background: #F9FAFB; }
.btn-primary { background: #0F766E; border-color: #0F766E; color: #FFFFFF; font-weight: 600; }
.btn-primary:hover { background: #0D6660; }
.btn-danger { border-color: #FCA5A5; color: #991B1B; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
fieldset.card { margin: 0; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
legend { padding: 0 6px; font-size: 15px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; min-width: 0; }
.field input[type=text], .field input[type=email], .field input[type=password], .field select { height: 44px; padding: 0 12px; border: 1px solid #D1D5DB; border-radius: 8px; font: inherit; font-size: 14px; background: #FFFFFF; width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid #99F6E4; border-color: #0F766E; }
.hint { font-weight: 400; color: #4B5563; font-size: 12.5px; }
.error { font-weight: 500; color: #B91C1C; font-size: 12.5px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice label { position: relative; display: block; min-height: 64px; padding: 12px 14px; border-radius: 10px; border: 2px solid #E5E7EB; cursor: pointer; font-weight: 600; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: #0F766E; background: #F0FDFA; }
.choice span { display: block; font-size: 12.5px; font-weight: 400; color: #4B5563; margin-top: 2px; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.app { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border-radius: 10px; border: 1px solid #E5E7EB; cursor: pointer; }
.app:has(input:checked) { border-color: #0F766E; background: #F0FDFA; }
.app b { display: block; font-size: 14px; font-weight: 500; }
.app code { font-size: 11.5px; color: #4B5563; }
.group-title { font-size: 13px; font-weight: 600; color: #374151; text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 8px; align-items: center; }
.env { background: #0F172A; border-radius: 12px; padding: 20px; color: #E2E8F0; }
.env pre { margin: 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.env .k { color: #5EEAD4; }
.flash { padding: 12px 16px; border-radius: 10px; background: #F0FDFA; border: 1px solid #99F6E4; color: #115E59; }
.flash-error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .grow { flex: 999 1 520px; min-width: 0; }
.split > .side { flex: 1 1 360px; min-width: 0; position: sticky; top: 20px; }

/* Onboarding progress */
.progress { height: 10px; border-radius: 999px; background: #E5E7EB; overflow: hidden; }
.progress > div { height: 100%; background: #0F766E; transition: width .4s; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 14px; padding: 14px 24px; border-top: 1px solid #F1F2F4; }
.dot { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; background: #F3F4F6; color: #4B5563; }
.dot.succeeded { background: #0F766E; color: #FFFFFF; }
.dot.running, .dot.waiting { background: #DBEAFE; color: #1E40AF; }
.dot.failed { background: #FEE2E2; color: #991B1B; }
.step-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.step-out { white-space: pre-wrap; font-size: 12.5px; color: #4B5563; }
.step-err { white-space: pre-wrap; font-size: 13px; color: #991B1B; background: #FEF2F2; border-radius: 8px; padding: 8px 10px; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 420px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .me { margin-top: 12px; }
  .main { padding: 20px 16px 40px; }
}
