/* Siteboard app + marketing styles */
:root {
  --bg: #f6f7fb; --panel: #fff; --ink: #1d2233; --muted: #687087; --line: #e3e6ef;
  --brand: #4f46e5; --brand-ink: #fff; --brand-soft: #eef0ff;
  --slate: #64748b; --blue: #2563eb; --amber: #d97706; --violet: #7c3aed; --green: #16a34a; --red: #dc2626;
  --radius: 10px; --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 2px 8px rgba(20, 24, 40, .04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: .55em 1em; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.big { padding: .8em 1.4em; font-size: 1.05rem; }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
.danger, button.link.danger { color: var(--red); }
:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
input, select, textarea { font: inherit; width: 100%; padding: .55em .7em; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
label { display: block; font-weight: 600; font-size: .9rem; }
label > input, label > select, label > textarea { margin-top: .3em; font-weight: 400; }
.stack > * + * { margin-top: .9rem; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; } .row > label { flex: 1 1 10rem; }
.error { background: #fef2f2; color: #991b1b; border-radius: 8px; padding: .6em .9em; }
.note { background: var(--brand-soft); border-radius: 8px; padding: .6em .9em; }
.flash { background: #ecfdf5; color: #065f46; border-radius: 8px; padding: .7em 1em; margin-bottom: 1rem; }

/* App shell */
body.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #151a2d; color: #c9cee0; padding: 1.2rem 1rem; display: flex; flex-direction: column; gap: .4rem; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: inherit; text-decoration: none; }
.side .brand { color: #fff; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: url(/assets/favicon.svg) center / cover; }
.ws { font-size: .8rem; color: #8a91aa; margin: 0 0 1rem 2.1rem; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #c9cee0; text-decoration: none; padding: .5rem .7rem; border-radius: 7px; }
.side nav a:hover { background: #222944; color: #fff; }
.side nav a.active { background: var(--brand); color: #fff; }
.viewsite { margin-top: auto; color: #a5b4fc; font-size: .9rem; padding: .5rem .7rem; }
.logout button { color: #8a91aa; font-size: .85rem; padding: .3rem .7rem; text-align: left; }
.main { padding: 1.6rem 2rem; min-width: 0; }
.pagehead { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.pagehead h1 { margin: 0; }
.pagehead > .btn, .pagehead > form.search { margin-left: auto; }
.pagehead > form.search + .btn { margin-left: 0; }
.search input { min-width: 18rem; }
.tabs { display: flex; background: #e8eaf3; border-radius: 8px; padding: 3px; }
.tabs a { padding: .3rem .8rem; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; }
.card.flush { padding: 0; overflow-x: auto; }
.narrowcard { max-width: 44rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.grid2.wide-left { grid-template-columns: 3fr 2fr; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.2rem; }
.kpi { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; }
.kpi span { display: block; color: var(--muted); font-size: .85rem; }
.kpi b { font-size: 1.7rem; }
.kpi.warn b { color: var(--amber); }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--slate); }
.dot-blue { background: var(--blue); } .dot-amber { background: var(--amber); } .dot-violet { background: var(--violet); } .dot-green { background: var(--green); } .dot-red { background: var(--red); }
.funnel { list-style: none; padding: 0; margin: 0 0 1rem; }
.funnel li { display: grid; grid-template-columns: .8rem 8rem 1fr 9rem; gap: .6rem; align-items: center; padding: .35rem 0; }
.fnum { text-align: right; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
progress { width: 100%; height: .7rem; appearance: none; border: 0; border-radius: 99px; background: #eef0f6; overflow: hidden; }
progress::-webkit-progress-bar { background: #eef0f6; border-radius: 99px; }
progress::-webkit-progress-value { background: var(--slate); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--slate); border-radius: 99px; }
.bar-blue::-webkit-progress-value { background: var(--blue); } .bar-blue::-moz-progress-bar { background: var(--blue); }
.bar-amber::-webkit-progress-value { background: var(--amber); } .bar-amber::-moz-progress-bar { background: var(--amber); }
.bar-violet::-webkit-progress-value { background: var(--violet); } .bar-violet::-moz-progress-bar { background: var(--violet); }
.bar-green::-webkit-progress-value { background: var(--green); } .bar-green::-moz-progress-bar { background: var(--green); }
.bar-red::-webkit-progress-value { background: var(--red); } .bar-red::-moz-progress-bar { background: var(--red); }

/* Board */
.hint { margin-top: -.6rem; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.col { background: #eceef5; border-radius: var(--radius); padding: .7rem; border-top: 4px solid var(--slate); min-height: 10rem; transition: background .15s; }
.col.over { background: #e1e5f5; }
.col-blue { border-top-color: var(--blue); } .col-amber { border-top-color: var(--amber); } .col-violet { border-top-color: var(--violet); } .col-green { border-top-color: var(--green); } .col-red { border-top-color: var(--red); }
.col header { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .6rem; }
.col h2 { font-size: .95rem; margin: 0; }
.count { background: #fff; border-radius: 99px; padding: 0 .5rem; font-size: .8rem; color: var(--muted); }
.sum { margin-left: auto; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cards { list-style: none; margin: 0; padding: 0; min-height: 2rem; display: flex; flex-direction: column; gap: .5rem; }
.dcard { background: #fff; border-radius: 8px; padding: .65rem .75rem; box-shadow: var(--shadow); cursor: grab; }
.dcard.dragging { opacity: .45; }
.dtitle { font-weight: 600; color: var(--ink); text-decoration: none; display: block; }
.dtitle:hover { color: var(--brand); }
.dmeta { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.dmeta b { color: var(--ink); }
.dfoot { display: flex; gap: .35rem; align-items: center; margin-top: .45rem; flex-wrap: wrap; }
.dfoot:empty { display: none; }
.avatar { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
.pill { font-size: .75rem; background: #f1f3f8; border-radius: 99px; padding: .05rem .5rem; color: var(--muted); }
.pill.late { background: #fef2f2; color: var(--red); }
.addcard { display: block; margin-top: .6rem; color: var(--muted); text-decoration: none; font-size: .9rem; padding: .3rem .2rem; }
.addcard:hover { color: var(--brand); }

/* Tables, tags, timeline, tasks */
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .65rem 1rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: .8rem; color: var(--muted); font-weight: 600; background: #fafbfd; }
table.data tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.tag { font-size: .78rem; font-weight: 600; border-radius: 99px; padding: .1rem .55rem; background: #f1f5f9; color: var(--slate); }
.tag-blue { background: #eff6ff; color: var(--blue); } .tag-amber { background: #fffbeb; color: #b45309; } .tag-violet { background: #f5f3ff; color: var(--violet); }
.tag-green { background: #f0fdf4; color: #15803d; } .tag-red { background: #fef2f2; color: var(--red); }
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; }
.timeline li { border-left: 3px solid var(--line); padding: .2rem 0 .8rem .9rem; }
.timeline li.kind-form { border-left-color: var(--green); }
.timeline li.kind-system .body { color: var(--muted); font-size: .9rem; }
.timeline .meta { font-size: .8rem; color: var(--muted); }
.plain { list-style: none; padding: 0; margin: 0; } .plain li { padding: .35rem 0; border-bottom: 1px solid var(--line); } .plain li:last-child { border: 0; }
.tasklist { list-style: none; padding: 0; margin: .5rem 0; }
.task { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task form { display: contents; }
.check { width: 1.35rem; height: 1.35rem; flex: none; border: 2px solid #c3c8d8; border-radius: 6px; background: #fff; cursor: pointer; color: #fff; font-size: .8rem; line-height: 1; padding: 0; }
.task.done .check { background: var(--green); border-color: var(--green); }
.task.done .ttitle { text-decoration: line-through; color: var(--muted); }
.ttitle { flex: 1; } .ttitle a { margin-left: .4rem; }
.due, .who { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.task.overdue .due { color: var(--red); font-weight: 600; }
.inline-add { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.inline-add input[name=title] { flex: 3 1 12rem; width: auto; } .inline-add input[type=date], .inline-add select { flex: 1 1 8rem; width: auto; }
.contactbox { margin-top: 1rem; padding: .8rem; background: #fafbfd; border-radius: 8px; }
.themes { border: 0; padding: 0; display: flex; gap: .6rem; flex-wrap: wrap; }
.themes legend { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.swatch { display: flex; align-items: center; gap: .4rem; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .7rem; cursor: pointer; }
.swatch input { width: auto; margin: 0; }
.swatch span { width: 1.1rem; height: 1.1rem; border-radius: 50%; }
.theme-ocean span { background: #0e7490; } .theme-forest span { background: #3f6212; } .theme-sunset span { background: #c2410c; } .theme-plum span { background: #86198f; } .theme-graphite span { background: #334155; }
.check-row { display: flex; gap: .5rem; align-items: center; } .check-row input { width: auto; margin: 0; }

/* Public / marketing */
body.public { background: #fff; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 1rem clamp(1rem, 4vw, 3rem); }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; padding: 3rem clamp(1rem, 4vw, 3rem) 4rem; max-width: 1200px; margin: 0 auto; }
.eyebrow { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); letter-spacing: -.02em; }
.lead { font-size: 1.15rem; color: #444b60; max-width: 36rem; }
.mini-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; background: #f1f2f8; border-radius: 16px; padding: 1rem; box-shadow: 0 20px 50px rgba(79, 70, 229, .15); }
.mini-col { display: flex; flex-direction: column; gap: .45rem; } .mini-col b { font-size: .7rem; color: var(--muted); }
.mini-col i { display: block; height: 2.6rem; border-radius: 6px; background: #fff; box-shadow: var(--shadow); border-left: 3px solid #c7d2fe; }
.mini-col i.hot { border-left-color: var(--brand); } .mini-col.won i { border-left-color: var(--green); }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem) 3rem; }
.features article { background: var(--bg); border-radius: 12px; padding: 1.2rem; } .features p { color: #444b60; margin: 0; }
.compare { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 4rem; }
.compare table { width: 100%; border-collapse: collapse; } .compare th, .compare td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.compare td:nth-child(2) { font-weight: 700; color: var(--green); }
.auth { max-width: 26rem; margin: 2rem auto 4rem; padding: 0 1rem; }
.narrow { max-width: 40rem; margin: 3rem auto; padding: 0 1rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .side { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .7rem 1rem; }
  .ws, .viewsite { display: none; }
  .side nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; }
  .logout { margin-left: auto; }
  .main { padding: 1rem; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid2, .grid2.wide-left, .hero, .features { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .funnel li { grid-template-columns: .8rem 1fr 6rem; } .funnel progress { display: none; }
  .search input { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
