/* ==========================================================================
   Vision2027 — Community & operations: boards, Q&A, support, tasks (§8, §15)
   ========================================================================== */

/* ---- Shared bits ----------------------------------------------------------- */
.badge--answered { background: rgba(63, 166, 107, .16); color: #25774A; font-weight: 700; }
.btn--danger-ghost { background: transparent; color: var(--danger); border: 1px solid rgba(194, 65, 12, .35); }
.btn--danger-ghost:hover { background: var(--danger-bg); color: var(--danger); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px 0; }
.compose { padding: 14px 18px; }
.compose > summary { list-style: none; cursor: pointer; display: inline-block; }
.compose > summary::-webkit-details-marker { display: none; }
.compose[open] > summary { margin-bottom: 14px; }
.compose__form { max-width: 820px; }
.notice { padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; }
.notice--warn { background: #FFF8E7; color: #7A5710; border-left: 4px solid var(--v27-gold); }
.notice--ok { background: var(--success-bg); color: #25774A; border-left: 4px solid var(--v27-leaf); margin-top: 12px; }
.avatar--sm { width: 34px; height: 34px; font-size: .75rem; flex: none; }
.inline-pair { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.dl-grid { display: grid; grid-template-columns: minmax(84px, max-content) minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: .92rem; }
.dl-grid dt { color: var(--muted); }
.dl-grid dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.dl-grid .dl-sub { padding-left: 14px; font-size: .85rem; }
.grid-split--wide { grid-template-columns: 1fr; }
@media (min-width: 1000px) { .grid-split--wide { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); } }
.narrow-col { max-width: 860px; }
.is-alert-text { color: var(--danger); font-weight: 700; }
.h4 { font-size: .95rem; margin: 16px 0 8px; }

/* ---- Discussion board: thread list ----------------------------------------- */
.thread-list { display: grid; gap: 12px; }
.thread-card { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 18px; margin: 0; }
.thread-card.is-pinned { border-left: 4px solid var(--v27-gold); }
.thread-card.is-hidden { opacity: .7; border-left: 4px solid var(--danger); }
.thread-card__stat { display: grid; place-items: center; min-width: 52px; padding: 6px 4px; border-radius: 12px; background: #F4F9FB; line-height: 1.1; }
.thread-card__stat b { font-family: var(--font-display); font-size: 1.1rem; color: var(--v27-deep); }
.thread-card__stat small { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.thread-card__stat.is-zero b { color: var(--muted); }
.thread-card__title { font-size: 1.05rem; margin: 0 0 4px; line-height: 1.3; overflow-wrap: anywhere; }
.thread-card__title a { color: var(--ink); text-decoration: none; }
.thread-card__title a:hover { color: var(--v27-ocean); text-decoration: underline; }
.thread-card__meta { margin: 0 0 6px; font-size: .84rem; color: var(--muted); }
.board-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 560px) {
  .thread-card { grid-template-columns: auto minmax(0, 1fr); }
  .thread-card__stat:first-child { display: none; }
}

/* ---- Discussion board: posts ---------------------------------------------- */
.thread-title { overflow-wrap: anywhere; }
.post { padding: 16px 18px; }
.post--thread { border-top: 4px solid var(--v27-ocean-2); }
.post__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.post__body { overflow-wrap: anywhere; }
.post__body > :last-child { margin-bottom: 0; }
.post__image { display: inline-block; margin-top: 10px; }
.post__image img { max-width: min(100%, 420px); max-height: 320px; border-radius: 12px; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.post__file { margin: 10px 0 0; }
.post__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 12px; }
.post__actions form { margin: 0; }
.post__more > summary { list-style: none; }
.post__more > summary::-webkit-details-marker { display: none; }
.post__more[open] { flex-basis: 100%; order: 10; }
.post__more[open] > form { margin-top: 10px; padding: 12px; border-radius: 12px; background: #F4F9FB; }
.post__removed { font-style: italic; margin: 0; }
.replies { display: grid; gap: 12px; margin: 22px 0; }
.replies > .h3 { margin: 0; }
.post--reply { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.post--reply.is-answer { border-left: 4px solid var(--v27-leaf); }
.post--reply.is-hidden { border-left: 4px solid var(--danger); background: #FFFBF8; }
.post__children { display: grid; gap: 10px; margin: 14px 0 0 14px; padding-left: 14px; border-left: 2px solid var(--line); }
.post--child { box-shadow: none; background: #FAFCFD; }
.post__reply { margin-top: 10px; }
.post__reply > summary { list-style: none; display: inline-block; }
.post__reply > summary::-webkit-details-marker { display: none; }
.post__reply[open] > form { margin-top: 10px; }
.vote-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.vote-btn:hover:not(:disabled) { border-color: var(--v27-ocean-2); color: var(--v27-deep); }
.vote-btn.is-voted { background: rgba(18, 165, 184, .12); border-color: var(--v27-ocean-2); color: var(--v27-deep); }
.vote-btn:disabled { cursor: default; opacity: .6; }
.report-card__post { margin: 8px 0; padding: 10px 14px; border-left: 3px solid var(--line); background: #F9FBFC; border-radius: 0 10px 10px 0; font-size: .92rem; }

/* ---- Public Q&A ------------------------------------------------------------ */
.qa-grid { display: grid; gap: 24px; }
@media (min-width: 960px) { .qa-grid { grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr); align-items: start; } .qa-grid > aside { position: sticky; top: 90px; } }
.qa-card { margin: 0; }
.qa-card__head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.qa-card__title { font-size: 1.15rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.qa-card__title a { color: var(--ink); text-decoration: none; }
.qa-card__title a:hover { color: var(--v27-ocean); text-decoration: underline; }
.faq-list { display: grid; gap: 8px; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; }
.faq-item > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.faq-item[open] > summary { margin-bottom: 8px; }
.page-hero--compact { padding-bottom: 12px; }

/* ---- Support conversation -------------------------------------------------- */
.convo { display: grid; gap: 12px; }
.convo__msg { padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); max-width: 92%; overflow-wrap: anywhere; }
.convo__msg header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.convo__msg--customer { justify-self: start; border-top-left-radius: 4px; }
.convo__msg--staff { justify-self: end; background: #EEF8FB; border-color: rgba(18, 165, 184, .3); border-top-right-radius: 4px; }
.convo__msg--internal { justify-self: end; background: #FFF8E7; border: 1px dashed rgba(201, 162, 74, .7); box-shadow: none; }
.convo__msg--resolution { justify-self: stretch; max-width: none; background: var(--success-bg); border-color: rgba(63, 166, 107, .4); }

/* ---- Task board ------------------------------------------------------------ */
.kanban { display: grid; gap: 16px; }
@media (min-width: 900px) { .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
.kanban__col { background: rgba(10, 46, 82, .04); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; min-width: 0; }
.kanban__col--blocked { background: rgba(194, 65, 12, .05); }
.kanban__head { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 4px; font-family: var(--font-accent); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kanban__empty { margin: 4px; }
.task-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--v27-ocean-2); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.task-card--urgent { border-left-color: var(--danger); }
.task-card--high { border-left-color: var(--v27-gold); }
.task-card--low { border-left-color: var(--line); }
.task-card.is-overdue { background: #FFFBF8; }
.task-card__top { display: flex; flex-wrap: wrap; gap: 6px; }
.task-card__title { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.task-card__title a { color: var(--ink); text-decoration: none; }
.task-card__title a:hover { color: var(--v27-ocean); text-decoration: underline; }
.task-card__meta { margin: 0; font-size: .82rem; color: var(--muted); }
.task-card form { margin: 0; }
.activity { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.activity__item { padding: 8px 12px; border-left: 3px solid var(--line); overflow-wrap: anywhere; }
.activity__item--comment { border-left-color: var(--v27-ocean-2); background: #F7FBFC; border-radius: 0 10px 10px 0; }
.activity__item--status { border-left-color: var(--v27-gold); }

/* ---- WhatsApp groups ------------------------------------------------------- */
.wa-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 0; }
.wa-row { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wa-row:last-child { border-bottom: 0; }
.wa-row.is-missing .wa-row__info strong::before { content: '● '; color: var(--danger); }
.wa-row__info { display: grid; gap: 2px; min-width: 0; }
.wa-row__form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wa-row__form input { flex: 1 1 260px; min-height: 42px; padding: 8px 12px; border: 1px solid rgba(10, 46, 82, .2); border-radius: var(--radius-sm); font: inherit; min-width: 0; }
@media (min-width: 900px) { .wa-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; } }

/* ---- Operations report ----------------------------------------------------- */
.report-grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.report-grid .card { margin: 0; }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .88rem; }
.bar-list li { display: grid; grid-template-columns: 120px 1fr 32px; gap: 10px; align-items: center; }
.bar-list b { text-align: right; }
.bar-list .bar { display: block; height: 8px; border-radius: 999px; background: #E3EEF3; overflow: hidden; }
.bar-list .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--v27-ocean-2), var(--v27-aqua)); border-radius: inherit; }

@media (prefers-reduced-motion: reduce) {
  .vote-btn, .thread-card__title a { transition: none; }
}
