/* Tendelis portal + admin - bold, warm, clean (matches tendelis.com) */
:root {
  --ink: #12142A; --ink-2: #1D2040; --text: #2A2D45; --muted: #646882; --line: #E9E3DA; --bg: #FAF7F2; --card: #FFFFFF;
  --brand: #FF5A36; --brand-dark: #E8441F; --brand-ink: #fff; --amber: #FFB020; --teal: #14B8A6; --blue: #3B82F6;
  --brand-soft: #FFEDE7; --amber-soft: #FFF4DC; --teal-soft: #DDF6F2; --blue-soft: #E5EEFF; --red-soft: #FDE7EA;
  --good: #0F8F82; --warn: #B26B00; --bad: #D4314F;
  --warm: linear-gradient(120deg, #FF5A36 0%, #FF8A2B 55%, #FFB020 100%);
  --shadow: 0 1px 2px rgba(18,20,42,.05), 0 10px 28px -14px rgba(18,20,42,.22);
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

/* header + tabs */
header.top { display: flex; align-items: center; gap: 16px; padding: 0 28px; height: 66px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
header.top .logo { display: inline-flex; align-items: center; gap: 10px; font: 700 20px var(--display); letter-spacing: -.03em; color: #fff; text-decoration: none; }
header.top .logo img { width: 32px; height: 32px; }
header.top .logo .dot { display: none; }
header.top .org { font-weight: 600; font-size: 14px; color: #C9CBDD; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.15); }
body.admin header.top .org { color: var(--amber); }
header.top .spacer { flex: 1; }
header.top #who { color: #C9CBDD; font-weight: 600; font-size: 14px; }
header.top a[href="/auth/logout"] { color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); }
header.top a[href="/auth/logout"]:hover { border-color: #fff; }
nav.tabs { display: flex; gap: 4px; padding: 0 28px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
nav.tabs button { border: 0; background: none; padding: 16px 14px 14px; font: 600 15px inherit; font-family: inherit; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; transition: color .15s; }
nav.tabs button:hover { color: var(--ink); }
nav.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }
nav.tabs .count { background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 6px; }

main { max-width: 1120px; margin: 32px auto 64px; padding: 0 28px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow); animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
h1, h2, h3 { font-family: var(--display); color: var(--ink); letter-spacing: -.02em; }
h1 { font-size: 28px; margin: 0 0 12px; font-weight: 700; line-height: 1.15; }
h2 { font-size: 20px; margin: 0 0 12px; font-weight: 600; } h3 { font-size: 16px; margin: 22px 0 10px; font-weight: 600; }
.muted { color: var(--muted); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; color: var(--ink); }
tr.click { cursor: pointer; } tr.click td { transition: background .15s; } tr.click:hover td { background: #FFF8F4; }
.audit, .audit td { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; } .audit td { padding: 7px 10px; font-weight: 400; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #F1EEE9; color: var(--muted); white-space: nowrap; text-transform: capitalize; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.resolved, .pill.executed, .pill.approved { background: var(--teal-soft); color: var(--good); }
.pill.waiting_approval, .pill.awaiting_reply, .pill.pending { background: var(--amber-soft); color: var(--warn); }
.pill.queued, .pill.working { background: var(--blue-soft); color: #2563EB; } .pill.queued::before, .pill.working::before { animation: pulse 1.2s ease-in-out infinite; }
.pill.escalated, .pill.needs_verification, .pill.failed, .pill.rejected, .pill.urgent { background: var(--red-soft); color: var(--bad); }
.pill.cancelled, .pill.closed { background: #F1EEE9; color: var(--muted); }
.pill.T3 { background: var(--red-soft); color: var(--bad); } .pill.T2 { background: var(--brand-soft); color: var(--brand-dark); }
@keyframes pulse { 50% { opacity: .35; } }

/* forms + buttons */
label { display: block; font-weight: 700; font-size: 14px; color: var(--ink); margin: 16px 0 7px; }
input[type=text], textarea, select { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-size: 16px; background: var(--bg); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
input[type=text]:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(255,90,54,.13); }
textarea { min-height: 140px; resize: vertical; }
.btn, button.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--brand); color: var(--brand-ink); border: 1.5px solid transparent; padding: 11px 20px; border-radius: 12px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: 0 6px 16px -8px rgba(255,90,54,.7); transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: none; } .btn.ghost:hover { border-color: var(--ink); background: var(--card); color: var(--ink); }
.btn.danger { background: var(--bad); box-shadow: none; } .btn.good { background: var(--teal); box-shadow: 0 6px 16px -8px rgba(20,184,166,.7); } .btn.good:hover { background: var(--good); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* conversation */
.thread { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.msg { padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); white-space: pre-wrap; max-width: 80%; line-height: 1.6; animation: rise .3s ease; }
.msg.customer { align-self: flex-end; background: var(--blue-soft); border-color: #D3E1FB; border-bottom-right-radius: 6px; }
.msg.agent { background: var(--brand-soft); border-color: #FBD9CD; border-bottom-left-radius: 6px; }
.msg.engineer { background: var(--teal-soft); border-color: #BEEDE6; border-bottom-left-radius: 6px; }
.msg.system { align-self: center; background: transparent; border: 1px dashed var(--line); font-size: 13.5px; color: var(--muted); max-width: 100%; text-align: center; }
.msg.internal { background: var(--amber-soft); border: 1px dashed #F2D28A; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; white-space: normal; letter-spacing: .02em; }
.msg a { font-weight: 700; word-break: break-all; }

/* admin stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--warm); }
.stat .n { font: 700 32px var(--display); color: var(--ink); letter-spacing: -.03em; } .stat .l { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.kill { border-color: #F3C2CB; } .kill.active { background: var(--red-soft); }

.empty { color: var(--muted); padding: 40px 24px; text-align: center; font-weight: 600; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--blue-soft); color: var(--ink); margin-bottom: 14px; font-weight: 600; }
.err { background: var(--red-soft); color: var(--bad); }
.devlogin main { max-width: 640px; }
.people { list-style: none; padding: 0; } .people li { padding: 10px 0; border-bottom: 1px solid var(--line); } .people span { color: var(--muted); font-size: 13px; margin-left: 6px; }

/* "we're working on your request" */
.working { display: flex; gap: 16px; align-items: center; padding: 18px 20px; margin: 20px 0; border-radius: 18px; background: linear-gradient(120deg, #FFF3EE, #FFF8EA); border: 1px solid #FBD9CD; font-size: 1.04rem; }
.working strong { color: var(--ink); }
.spinner { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 3px solid #FBD9CD; border-top-color: var(--brand); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.resolve-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; margin: 20px 0 6px; border-radius: 16px; background: var(--teal-soft); border: 1px solid #BEEDE6; font-weight: 600; color: var(--ink); }

@media (max-width: 700px) {
  header.top { padding: 0 16px; } header.top #who, header.top .org { display: none; }
  nav.tabs { padding: 0 12px; } main { padding: 0 14px; margin-top: 20px; } .card { padding: 20px; }
  .msg { max-width: 100%; } th:nth-child(4), td:nth-child(4) { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- signup wizard ---------------- */
body.signup header.top a.plain { color: #C9CBDD; font-weight: 600; font-size: 14px; text-decoration: none; }
body.signup header.top a.plain:hover { color: #fff; }
main.narrow { max-width: 720px; }
.lead { font-size: 17px; line-height: 1.55; color: var(--text); margin: 0 0 8px; }
.hint { font-size: 14px; color: var(--muted); margin: 0 0 8px; line-height: 1.5; }
.hint.tip { background: var(--amber-soft); color: var(--ink); padding: 12px 14px; border-radius: 12px; margin-top: 16px; }
.center { text-align: center; }
input[type=email], input[type=tel], input[type=number] { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-size: 16px; background: var(--bg); color: var(--ink); }
input[type=email]:focus, input[type=tel]:focus, input[type=number]:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(255,90,54,.13); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.counter { display: flex; gap: 10px; align-items: center; max-width: 260px; }
.counter input { text-align: center; font-weight: 700; font-size: 20px; }
.counter .btn { font-size: 22px; padding: 8px 18px; }
.actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 26px; flex-wrap: wrap; }
.btn.big { padding: 14px 26px; font-size: 17px; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 22px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-size: 13px; }
.steps li.on { color: var(--ink); border-color: var(--brand); } .steps li.on span { background: var(--brand); color: #fff; }
.steps li.done span { background: var(--teal); color: #fff; }
.choices, .plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 4px; }
@media (max-width: 620px) { .choices, .plans { grid-template-columns: 1fr; } }
.choice, .plan { position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.choice:hover, .plan:hover { border-color: #CFC6B8; transform: translateY(-1px); }
.choice.on, .plan.on { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255,90,54,.13); }
.choice b, .plan b { font: 600 18px var(--display); color: var(--ink); }
.choice span, .plan span { font-size: 14px; color: var(--muted); line-height: 1.45; }
.plan .price { font: 700 30px var(--display); color: var(--ink); letter-spacing: -.02em; } .plan .price small { font: 600 14px inherit; color: var(--muted); }
.plan .tag { position: absolute; top: -12px; right: 16px; background: var(--warm); color: #fff; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
label.tick { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; margin-top: 20px; cursor: pointer; }
label.tick input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); flex: none; }
ol.simple { padding-left: 22px; line-height: 1.7; font-size: 16px; } ol.simple li { margin-bottom: 6px; }
.big-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 34px; font-weight: 800; margin-bottom: 14px; }
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 16px; }
@media (max-width: 620px) { .howto { grid-template-columns: 1fr; } }
.howto div { background: var(--bg); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.howto b { color: var(--ink); } .howto span { font-size: 14px; color: var(--muted); }
details.faq { border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 16px; }
details.faq summary { font-weight: 700; color: var(--ink); cursor: pointer; }
.guide h2 { margin-top: 30px; } .guide p, .guide li { line-height: 1.65; font-size: 16px; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.team-row .who { flex: 1; } .team-row .who b { color: var(--ink); display: block; }

.card.approval.focus { border: 2px solid var(--brand); box-shadow: 0 0 0 5px rgba(255,90,54,.12); }
.pill.active { background: var(--teal-soft); color: var(--good); } .pill.deactivated { background: var(--amber-soft); color: var(--warn); } .pill.access_removed { background: var(--red-soft); color: var(--bad); }
.pill.needs_portal { background: var(--brand-soft); color: var(--brand-dark); }

/* new-business setup: domain finder, plan cards, website add-on, summary */
.plans.three { grid-template-columns: repeat(3, 1fr); } @media (max-width: 760px) { .plans.three { grid-template-columns: 1fr; } }
.plans.three .price { font-size: 24px; }
.domains { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
label.dom { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0; font-weight: 600; background: var(--card); }
label.dom.on { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255,90,54,.12); }
label.dom.taken { opacity: .55; cursor: default; } label.dom .d { flex: 1; color: var(--ink); font-size: 16px; word-break: break-all; }
label.dom .s { font-size: 14px; color: var(--muted); font-weight: 500; white-space: nowrap; } label.dom .ok { color: var(--good); }
label.dom input { accent-color: var(--brand); width: 18px; height: 18px; }
.addon { border: 2px dashed var(--line); border-radius: 16px; padding: 18px 20px; margin: 22px 0 8px; } .addon.on { border-style: solid; border-color: var(--brand); }
.styles { display: flex; gap: 12px; flex-wrap: wrap; }
.sty { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; font: 600 14px inherit; font-family: inherit; color: var(--ink); }
.sty.on { border-color: var(--brand); } .sty .sw { width: 64px; height: 40px; border-radius: 8px; display: grid; place-items: center; border: 1px solid rgba(0,0,0,.08); } .sty .sw i { width: 30px; height: 10px; border-radius: 5px; display: block; }
.summary { background: var(--bg); border-radius: 14px; padding: 14px 18px; margin: 18px 0 10px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; } .summary .row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 18px; color: var(--ink); }
