/* Fusion KanBan. Light and dark themes: follows the device unless the user picked one (html[data-theme]). */
:root {
  --bg: #f1f5f9; --surface: #ffffff; --surface-alt: #e8edf3; --border: #d6dee8;
  --text: #0f172a; --muted: #64748b; --accent: #0b57c9; --accent-2: #1d8bf0;
  --danger: #dc2626; --ok: #16a34a;
  --shadow: 0 1px 3px rgba(16,24,40,.08); --shadow-lg: 0 20px 50px rgba(15,23,42,.25);
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #1e293b; --surface-alt: #141c2e; --border: #2c3a52;
    --text: #e2e8f0; --muted: #94a3b8; --accent: #3b82f6; --accent-2: #60a5fa;
    --shadow: 0 1px 3px rgba(0,0,0,.35); --shadow-lg: 0 20px 50px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120; --surface: #1e293b; --surface-alt: #141c2e; --border: #2c3a52;
  --text: #e2e8f0; --muted: #94a3b8; --accent: #3b82f6; --accent-2: #60a5fa;
  --shadow: 0 1px 3px rgba(0,0,0,.35); --shadow-lg: 0 20px 50px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--accent-2); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
small { color: var(--muted); font-weight: 400; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
.notice, .boot { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 9px;
       padding: .6rem 1.1rem; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; color: var(--text);
       background: transparent; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn.sm { padding: .38rem .75rem; font-size: .84rem; }
.btn.block { width: 100%; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: var(--border); background: var(--surface); }
.btn.ghost:hover, .btn.ghost.on { border-color: var(--accent-2); color: var(--accent-2); }
.btn.danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); background: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.4rem; line-height: 1; padding: .25rem .4rem; border-radius: 8px; }
.iconbtn:hover { color: var(--text); background: var(--surface-alt); }
.iconbtn svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .iconbtn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent-2) 60%, transparent); outline-offset: 1px; }
.seg { display: inline-flex; gap: .3rem; flex-wrap: wrap; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .back { color: var(--muted); text-decoration: none; font-size: .85rem; white-space: nowrap; }
.topbar .back:hover { color: var(--accent-2); }
.appname { font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; gap: .55rem; flex: 1; min-width: 0; }
.appname .company { font-weight: 500; color: var(--muted); font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appname .company:not(:empty)::before { content: "· "; }
.logo { display: inline-flex; gap: 2px; align-items: flex-start; height: 20px; }
.logo i { width: 6px; border-radius: 2px; background: var(--accent-2); }
.logo i:nth-child(1) { height: 20px; } .logo i:nth-child(2) { height: 13px; opacity: .8; } .logo i:nth-child(3) { height: 16px; opacity: .6; }
.topright { display: flex; align-items: center; gap: .5rem; }
.acct { position: relative; }
.menu, .popmenu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
                  box-shadow: var(--shadow-lg); padding: .3rem; min-width: 190px; z-index: 50; }
.popmenu { position: fixed; top: auto; right: auto; max-height: 70vh; overflow: auto; }
.menu button, .popmenu button { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text);
                                font: inherit; font-size: .88rem; padding: .45rem .7rem; border-radius: 7px; cursor: pointer; }
.menu button:hover, .popmenu button:hover { background: var(--surface-alt); }
.popmenu hr { margin: .3rem 0; }
.popmenu .dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }

/* ---------- signed out ---------- */
.auth { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; max-width: 1080px; margin: 2.5rem auto; padding: 0 1rem; align-items: start; }
.intro .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent-2); margin: 0 0 .5rem; }
.intro h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; margin-bottom: .8rem; }
.intro p { color: var(--muted); }
.ticks { padding: 0; list-style: none; margin: 1.2rem 0; }
.ticks li { padding-left: 1.7rem; position: relative; margin: .55rem 0; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.fine { font-size: .85rem; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.card h3 { margin-bottom: .5rem; }
.authcard { padding: 1.5rem; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-alt); border-radius: 10px; padding: 4px; margin-bottom: 1.2rem; }
.tabs2 button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: .5rem; border-radius: 8px; cursor: pointer; }
.tabs2 button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.form { display: grid; gap: .8rem; }
.form label { display: grid; gap: .3rem; font-size: .88rem; font-weight: 600; }
.form label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.form label.check input { width: auto; }
.form .hp { position: absolute; left: -9999px; }
.form.grid2 { grid-template-columns: 1fr 1fr; }
.form.grid2 .err, .form.grid2 > div { grid-column: 1 / -1; }
.err { color: var(--danger); font-size: .86rem; margin: 0; min-height: 0; }
.err:empty, .ok:empty { display: none; }
.ok { color: var(--ok); font-size: .86rem; margin: 0; }
.linkbtn { border: 0; background: none; color: var(--accent-2); font: inherit; font-size: .86rem; cursor: pointer; padding: .2rem; justify-self: center; }
.linkbtn:hover { text-decoration: underline; }
.form h3 { margin: 0; }
.done h3 { margin-bottom: .6rem; }
.done p { color: var(--muted); }

/* ---------- pricing (signed out) ---------- */
.pricing { grid-column: 1 / -1; margin-top: 1.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.pricing-head { text-align: center; max-width: 640px; margin: 0 auto 1.6rem; }
.pricing-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: .6rem; }
.pricing-head p { color: var(--muted); margin: 0 0 .5rem; }
.pricing-head .trial { color: var(--text); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: stretch; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.3rem; }
.plan.featured { border: 2px solid var(--accent-2); }
.plan .badge { position: absolute; top: -.75rem; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--accent), var(--accent-2));
               color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 999px; padding: .2rem .75rem; white-space: nowrap; }
.plan h3 { font-size: 1.15rem; font-weight: 800; }
.plan .who { color: var(--muted); font-size: .88rem; margin: .2rem 0 .8rem; }
.plan .price { font-size: 2.3rem; font-weight: 800; line-height: 1; margin: 0; letter-spacing: -.02em; }
.plan .price .cur { font-size: 1.2rem; vertical-align: top; margin-right: .1rem; }
.plan .price .per { font-size: .9rem; font-weight: 500; color: var(--muted); margin-left: .2rem; letter-spacing: 0; }
.plan .yearly { color: var(--muted); font-size: .84rem; margin: .45rem 0 0; }
.plan .ticks { margin: 1rem 0 0; font-size: .9rem; }
.pricing-foot { text-align: center; max-width: 720px; margin: 1.4rem auto 0; }

/* ---------- board ---------- */
.boardview { padding: 1rem 1.25rem 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.toolbar h2 { font-size: 1.3rem; font-weight: 800; }
.toolbar .count { color: var(--muted); font-size: .9rem; font-weight: 500; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.filters input, .filters select { width: auto; padding: .35rem .55rem; font-size: .85rem; }
.filters input { min-width: 180px; }
.actions { display: flex; gap: .4rem; align-items: center; }
.hint { color: var(--muted); font-size: .82rem; margin: .6rem 0 .8rem; }
.kb-wrap { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: 1.2rem; align-items: flex-start; scroll-behavior: smooth; min-height: calc(100vh - 190px); }
.kb-col { flex: 1 1 0; min-width: 250px; max-width: 360px; background: var(--surface-alt); border-radius: 14px; padding: .6rem;
          border-top: 4px solid var(--kb-color, #64748b); display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.kb-col.kb-over { outline: 2px dashed var(--accent-2); background: color-mix(in srgb, var(--accent-2) 10%, var(--surface-alt)); }
.kb-col .colhead { display: flex; align-items: center; gap: .4rem; padding: .15rem .25rem .55rem; }
.kb-col .colhead h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); flex: 1; min-width: 0;
                      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-col .colhead .done-tag { font-size: .65rem; color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 50%, transparent); border-radius: 999px; padding: 0 .4rem; }
.kb-col .cnt { background: var(--surface); border-radius: 999px; font-size: .72rem; padding: .05rem .55rem; color: var(--muted); }
.kb-col .colmenu { font-size: 1.1rem; padding: 0 .3rem; }
.kb-col .cards { flex: 1; overflow-y: auto; min-height: 60px; padding: 2px; }
.kb-col .addcard { margin-top: .3rem; width: 100%; border: 1px dashed var(--border); background: transparent; color: var(--muted); border-radius: 9px;
                   padding: .4rem; font: inherit; font-size: .84rem; cursor: pointer; }
.kb-col .addcard:hover { color: var(--accent-2); border-color: var(--accent-2); }
.kb-addcol { flex: 0 0 200px; border: 2px dashed var(--border); border-radius: 14px; background: transparent; color: var(--muted); font: inherit; font-weight: 600;
             padding: 1.5rem .5rem; cursor: pointer; align-self: stretch; max-height: 140px; }
.kb-addcol:hover { color: var(--accent-2); border-color: var(--accent-2); }

.kb-card { background: var(--surface); border-radius: 11px; padding: .65rem .8rem; margin-bottom: .55rem; cursor: pointer; border-left: 4px solid var(--cat-color, #64748b);
           box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; user-select: none; }
.kb-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.kb-card.kb-dragging { opacity: .45; }
.kb-card .top { display: flex; justify-content: space-between; align-items: center; }
.kb-card .cmenu { color: var(--muted); font-size: 1.1rem; padding: 0 .3rem; }
.kb-card .t { font-weight: 700; font-size: .92rem; margin: .35rem 0 .35rem; overflow-wrap: anywhere; }
.kb-card .m { font-size: .76rem; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .2rem; }
.kb-card .who { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-card .who .ico { width: 13px; height: 13px; }
.kb-card .when, .kb-card .notes-n { white-space: nowrap; flex: none; }
.kb-card .unassigned { font-style: italic; opacity: .75; }
.kb-card .notes-n { display: inline-flex; align-items: center; gap: .25rem; }
.kb-prio { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #fff; border-radius: 999px; padding: .12rem .55rem; background: var(--p-color, #64748b); }
.kb-empty { color: var(--muted); font-size: .8rem; text-align: center; padding: .8rem 0; }
.kb-pop { position: fixed; font-size: 2.2rem; pointer-events: none; animation: kbpop .9s ease-out forwards; z-index: 2000; }
@keyframes kbpop { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.8) translateY(-70px); opacity: 0; } }

/* ---------- pages (archived, team, requests) ---------- */
.page { max-width: 1080px; margin: 1.5rem auto; padding: 0 1rem; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pagehead h2 { font-size: 1.4rem; font-weight: 800; }
.page > .muted { margin-top: -.3rem; }
.list .row { display: flex; gap: 1rem; align-items: center; padding: .8rem .2rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list .row:last-child { border-bottom: 0; }
.list .row .main { flex: 1; min-width: 220px; }
.list .row .main b { display: block; }
.list .row .sub { color: var(--muted); font-size: .84rem; }
.list .row .btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.list .empty { color: var(--muted); padding: 1rem .2rem; margin: 0; }
.pill { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; padding: .1rem .55rem;
        border: 1px solid currentColor; }
.pill.pending { color: #f59e0b; } .pill.approved { color: var(--ok); } .pill.denied { color: var(--danger); } .pill.owner { color: var(--accent-2); } .pill.member { color: var(--muted); }

/* ---------- dialogs ---------- */
.dlg { border: 1px solid var(--border); border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 24px));
       box-shadow: var(--shadow-lg); max-height: calc(100vh - 32px); }
.dlg.wide { width: min(1060px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(2,6,23,.6); }
.dlg[open] { display: flex; flex-direction: column; }
.dlg > form { display: flex; flex-direction: column; min-height: 0; gap: 0; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.dlg-head h3 { font-size: 1.1rem; }
.dlg-body { padding: 1.1rem 1.25rem; overflow-y: auto; display: grid; gap: .8rem; }
.dlg-foot { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; padding: .85rem 1.25rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.dlg-foot .err { margin-right: auto; }
.dlg-foot #cdDelete, .dlg-foot #colDelete { margin-right: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatches button { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; background: var(--sw); }
.swatches button.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }

/* card detail */
.cd { grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.cd .field { display: grid; gap: .35rem; margin-bottom: .9rem; }
.cd .field > label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cd #cdTitle { font-size: 1.1rem; font-weight: 700; }
.prio button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .8rem; font: inherit; font-size: .82rem;
               font-weight: 600; cursor: pointer; }
.prio button.on { background: var(--p-color); border-color: var(--p-color); color: #fff; }
.saverow { display: flex; gap: .4rem; }
.notes { list-style: none; padding: 0; margin: 0 0 .4rem; display: grid; gap: .6rem; }
.notes li { border-left: 3px solid var(--border); padding: .1rem 0 .1rem .75rem; }
.notes .meta { font-size: .78rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.notes .meta b { color: var(--text); }
.notes .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.notes .del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .78rem; margin-left: auto; }
.notes .del:hover { color: var(--danger); }
.notes .none { border: 0; padding: 0; color: var(--muted); font-size: .88rem; }
.cd-side { background: var(--surface-alt); border-radius: 12px; padding: 1rem; }
.cd-side .info { margin-top: .4rem; }
.cd-side h4 { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .6rem 0 .5rem; }
.cd-side dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: 0; font-size: .86rem; }
.cd-side dt { color: var(--muted); }
.cd-side dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; font-size: .82rem; max-height: 300px; overflow-y: auto; }
.activity li { border-left: 2px solid var(--border); padding-left: .6rem; }
.activity .when { color: var(--muted); font-size: .74rem; display: block; }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .6rem 1.1rem; border-radius: 10px;
         font-size: .9rem; z-index: 3000; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--danger); color: #fff; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; margin-top: 1.5rem; }
  .plans { grid-template-columns: 1fr; gap: 1.4rem; }
  .cd { grid-template-columns: 1fr; }
  .form.grid2, .row2 { grid-template-columns: 1fr; }
  .kb-col { min-width: 82vw; }
  .topbar .back span { display: none; }
  .hint { display: none; }
  .toolbar h2 { flex: 1; }
  .filters { order: 3; flex: 1 1 100%; }
  .filters input { min-width: 0; flex: 1 1 100%; }
  .filters select { flex: 1 1 30%; min-width: 0; }
  .appname { font-size: 1rem; }
  .appname .company { display: none; }
}

/* ---------- product landing page colours (landing.css); the sticky top bar is about 57px tall ---------- */
.landing { --lp-bg: var(--bg); --lp-surface: var(--surface); --lp-border: var(--border); --lp-text: var(--text); --lp-muted: var(--muted);
           --lp-accent: var(--accent); --lp-accent2: var(--accent-2); --lp-good: var(--ok); --lp-grid: color-mix(in srgb, var(--text) 6%, transparent);
           --lp-glow1: #3b82f6; --lp-glow2: #8b5cf6; --lp-top: 57px; }

/* ---------- requests moved to the site's Admin; "choose a plan" screen when a trial or subscription has ended ---------- */
.card.padded { padding: 1.4rem 1.6rem; }
.access-card { max-width: 560px; margin: 2rem auto; }
.access-card .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--accent-2); margin: 0 0 .5rem; }
.access-card h2 { margin: 0 0 .6rem; }
.acc-sent { padding: .6rem .9rem; border-radius: 10px; background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.acc-foot { text-align: center; margin-top: 1rem; }
