/* Present CRM roadmap — layout & components. Brand values come from /brand/brand.css */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5;
}
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; color: var(--brand-primary); line-height: 1.2; margin: 0; }
a { color: var(--brand-primary); }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--brand-primary); color: var(--brand-on-primary); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brand-primary); min-width: 0; }
.brand-logo { height: var(--logo-height); width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-family: var(--font-heading); font-weight: 600; font-size: 1.3rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.brand-sub { font-size: .78rem; color: var(--text-muted); letter-spacing: .14em; text-transform: uppercase; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--brand-primary); color: var(--brand-on-primary); }
.btn-primary:hover { background: var(--brand-primary-hover); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--brand-primary); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--bug); border-color: #e3b9b2; }
.btn-danger:hover { background: var(--bug-bg); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--text-muted); border-radius: 999px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* Intro */
.intro { padding-top: 36px; padding-bottom: 8px; }
.intro h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); max-width: 22ch; }
.tagline { margin: 10px 0 6px; color: var(--text-muted); max-width: 60ch; font-size: 1.05rem; }
.updated { margin: 0; font-size: .88rem; color: var(--text-muted); }
.wrap.updated { margin: 0 auto; }
.updated strong { color: var(--text); font-weight: 600; }

/* Toolbar */
.toolbar { padding-top: 18px; padding-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; max-width: 100%; }
.segmented button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: .92rem; color: var(--text-muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; min-height: 40px; white-space: nowrap; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--brand-primary); box-shadow: 0 1px 3px rgba(24,59,40,.15); }
.seg-count { font-weight: 500; opacity: .75; margin-left: 2px; }

/* Board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-bottom: 48px; align-items: start; }
.column { background: rgba(255,255,255,.35); border: 1px solid var(--border); border-radius: 16px; padding: 12px; min-width: 0; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.column-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--text-muted)); flex: none; }
.column-head h2 { font-size: 1.12rem; }
.column-count { margin-left: auto; font-size: .8rem; font-weight: 700; min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.column-desc { margin: -6px 4px 10px; font-size: .8rem; color: var(--text-muted); }
.card-list { display: flex; flex-direction: column; gap: 10px; min-height: 40px; list-style: none; margin: 0; padding: 0; }
.empty { font-size: .85rem; color: var(--text-muted); text-align: center; padding: 16px 8px; border: 1px dashed var(--border); border-radius: 12px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(24,59,40,.05); position: relative; }
.card h3 { font-family: var(--font-body); font-weight: 600; font-size: .98rem; color: var(--text); margin: 6px 0 4px; overflow-wrap: anywhere; }
.card-desc { margin: 0; font-size: .88rem; color: var(--text-muted); overflow-wrap: anywhere; white-space: pre-line; }
.card-desc.clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { border: 0; background: none; padding: 4px 0 0; font: inherit; font-size: .82rem; color: var(--brand-primary); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-foot:empty { display: none; }
.card-foot { align-items: center; margin-top: 8px; font-size: .78rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; line-height: 1.6; }
.chip-bug { background: var(--bug-bg); color: var(--bug); }
.chip-feature { background: var(--feature-bg); color: var(--feature); }
.chip-prio { background: var(--surface-2); color: var(--text); }
.chip-prio[data-p="high"], .chip-prio[data-p="critical"] { background: var(--brand-accent-soft); color: #5b4b10; }
.chip-example { background: transparent; color: var(--text-muted); border: 1px dashed var(--text-muted); }

.board-error { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.skeleton { height: 92px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--surface); }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; padding-bottom: 16px; font-size: .85rem; color: var(--text-muted); }
.footer-row p { margin: 0; }
.footer-admin { color: var(--text-muted); }

/* Dialog */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(15,42,28,.3); }
dialog::backdrop { background: rgba(15,42,28,.45); }
dialog form, .thanks { padding: 20px 22px 22px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dialog-head h2 { font-size: 1.35rem; padding-top: 8px; }
fieldset { border: 0; margin: 0 0 14px; padding: 0; }
legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-pick legend { grid-column: 1 / -1; }
.type-opt { position: relative; }
.type-opt input { position: absolute; opacity: 0; inset: 0; }
.type-opt span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1.5px solid var(--border); border-radius: 12px; font-weight: 600; cursor: pointer; background: var(--surface); }
.type-opt input:checked + span { border-color: var(--brand-primary); background: var(--feature-bg); color: var(--brand-primary); }
.type-opt input:focus-visible + span { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > span { font-weight: 600; font-size: .9rem; }
.field em { font-style: normal; font-weight: 400; color: var(--text-muted); font-size: .8rem; margin-left: 4px; }
.field input, .field textarea, .field select { font: inherit; font-size: 16px; width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); }
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand-primary); outline: none; box-shadow: 0 0 0 3px var(--brand-accent-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--bug); font-size: .8rem; min-height: 0; }
.err:empty { display: none; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fineprint { font-size: .8rem; color: var(--text-muted); margin: 4px 0 8px; }
.form-status { font-size: .88rem; color: var(--bug); margin: 0 0 8px; }
.form-status:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.thanks { text-align: center; }
.thanks-mark { width: 56px; height: 56px; margin: 8px auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-primary); color: var(--brand-on-primary); font-size: 1.6rem; }
.thanks p { color: var(--text-muted); margin: 8px 0 18px; }

/* Responsive */
@media (max-width: 1080px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .header-row { min-height: 58px; }
  :root { --logo-height: 34px; }
  .brand-name { font-size: 1.08rem; }
  .intro { padding-top: 22px; }
  .board { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 8px 6px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .footer-row { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) { #open-submit { padding: 0 14px; } }
.lbl-short { display: none; }
@media (max-width: 400px) { .lbl-long { display: none; } .lbl-short { display: inline; } }
@media (max-width: 300px) { .brand-text { display: none; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Admin ---------- */
.admin-badge { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--brand-accent-soft); color: #5b4b10; padding: 3px 8px; border-radius: 999px; }
.login-card { max-width: 420px; margin: 56px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.login-card p { color: var(--text-muted); margin: 0 0 16px; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 14px; }
.admin-bar h1 { font-size: 1.6rem; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inbox { background: var(--surface); border: 2px solid var(--brand-accent); border-radius: 16px; padding: 14px; margin-bottom: 20px; }
.inbox-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.inbox-head h2 { font-size: 1.2rem; }
.inbox-note { margin: 0 0 12px; font-size: .85rem; color: var(--text-muted); }
.inbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.submitter { font-size: .8rem; color: var(--text-muted); margin-top: 6px; overflow-wrap: anywhere; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.card-actions select { font: inherit; font-size: .85rem; min-height: 36px; padding: 0 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); max-width: 100%; }
.admin-card { padding-left: 40px; }
.drag-handle { position: absolute; left: 4px; top: 8px; width: 32px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-muted); cursor: grab; touch-action: none; border-radius: 8px; }
.drag-handle:hover { background: var(--surface-2); }
.card.dragging-src { opacity: .35; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; box-shadow: 0 16px 40px rgba(15,42,28,.3); transform: rotate(1.5deg); opacity: .95; }
.drop-marker { height: 4px; border-radius: 4px; background: var(--brand-accent); margin: -3px 0; }
.column.drop-over { border-color: var(--brand-accent); background: rgba(232,224,176,.35); }
body.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }
.archive { margin: 4px 0 40px; }
.archive summary { cursor: pointer; font-weight: 600; color: var(--brand-primary); padding: 8px 0; }
.archive .inbox-list { margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--brand-primary); color: var(--brand-on-primary); padding: 10px 18px; border-radius: 999px; font-size: .9rem; z-index: 200; box-shadow: 0 8px 24px rgba(15,42,28,.3); max-width: calc(100vw - 32px); }
.toast.err { background: var(--bug); }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; margin-bottom: 12px; }
.check input { width: 18px; height: 18px; }
.edit-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.edit-actions .right { display: flex; gap: 10px; }

.site-header .admin-actions { flex-wrap: nowrap; gap: 6px; }
@media (max-width: 640px) { .hide-sm { display: none; } .site-header .btn-sm { padding: 0 10px; } }
.lbl-short-admin { display: none; }
@media (max-width: 640px) { .lbl-short-admin { display: inline; } }
