/* ============================================================================
   Live Board v2 — template-style dashboard (KPI row, 3 status columns,
   lower charts, activity feed) + status timeline. Loaded after tv.css.
   ========================================================================== */

/* KPI row */
.kpirow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-tv { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-tv__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-tv__l { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.kpi-tv__v { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-tv__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-tv__icon svg { width: 21px; height: 21px; }
.kpi-tv__sub { font-size: 11.5px; font-weight: 600; margin-top: 8px; color: var(--text-3); }
.kpi-tv--blue   .kpi-tv__icon { color: #181818; background: color-mix(in srgb, #181818 15%, transparent); }
.kpi-tv--amber  .kpi-tv__icon { color: #d99a2b; background: color-mix(in srgb, #d99a2b 16%, transparent); }
.kpi-tv--green  .kpi-tv__icon { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.kpi-tv--violet .kpi-tv__icon { color: #ad9c82; background: color-mix(in srgb, #ad9c82 16%, transparent); }
.kpi-tv--red    .kpi-tv__icon { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.kpi-tv--red .kpi-tv__v { color: var(--danger); }
.kpi-tv--amber .kpi-tv__sub { color: #b9822b; }
.kpi-tv--blue .kpi-tv__sub, .kpi-tv--green .kpi-tv__sub, .kpi-tv--violet .kpi-tv__sub { color: var(--ok); }
@media (max-width: 1100px) { .kpirow { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .kpirow { grid-template-columns: repeat(2, 1fr); } .kpi-tv__v { font-size: 24px; } }

/* board toolbar */
.boardbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--text-2); font-weight: 600; font-size: 12.5px; padding: 7px 13px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 15px; height: 15px; }
.seg button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

/* 3 status columns */
.board3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.bcol { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 340px); min-height: 220px; }
.bcol__head { display: flex; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.bcol__dot { width: 9px; height: 9px; border-radius: 50%; }
.bcol__dot--amber { background: #d99a2b; } .bcol__dot--green { background: var(--ok); } .bcol__dot--violet { background: #ad9c82; }
.bcol__title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.bcol__count { margin-left: auto; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 800; min-width: 24px; text-align: center; padding: 1px 8px; border-radius: 20px; }
.bcol__body { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 11px; }
.bcol__empty { text-align: center; color: var(--text-3); font-size: 12px; padding: 24px 0; }
.bcol__add { margin: 0 12px 12px; border: 1px dashed var(--border-strong); background: transparent; color: var(--text-2); border-radius: var(--radius-sm); padding: 9px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.bcol__add:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 980px) { .board3 { grid-template-columns: 1fr; } .bcol { max-height: none; } }

/* board task cards */
.tcard-tv { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 11px 12px; cursor: pointer; box-shadow: var(--shadow); }
.tcard-tv:hover { border-color: var(--border-strong); }
.tcard-tv.tcard--critical { border-left-color: var(--pri-critical); } .tcard-tv.tcard--urgent { border-left-color: var(--pri-urgent); }
.tcard-tv.tcard--high { border-left-color: var(--pri-high); } .tcard-tv.tcard--medium { border-left-color: var(--pri-medium); } .tcard-tv.tcard--low { border-left-color: var(--pri-low); }
.tcard-tv--new { border-left-color: #d99a2b; }
.tcard-tv--done { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 4%, var(--surface)); }
.tcard-tv__head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.tcard-tv__owner { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard-tv__head .pill { margin-left: auto; }
.tcard-tv__title { font-weight: 700; font-size: 14px; line-height: 1.35; margin-bottom: 8px; }
.tcard-tv__tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.tcard-tv__note { font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border-radius: 6px; padding: 6px 8px; margin-top: 9px; display: flex; align-items: center; gap: 5px; }
.tcard-tv__note svg { width: 12px; height: 12px; flex: none; color: var(--text-3); }
.tcard-tv__foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.tcard-tv__foot .sep { margin-left: auto; }
.done-check { width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); display: grid; place-items: center; flex: none; }
.done-check svg { width: 14px; height: 14px; }

/* mini three-date row */
.minidates { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--text-2); }
.minidates span { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.minidates svg { width: 12px; height: 12px; color: var(--text-3); }
.minidates .md-due.over { color: var(--danger); } .minidates .md-due.over svg { color: var(--danger); }
.minidates .md-due.soon { color: var(--warn); } .minidates .md-due.soon svg { color: var(--warn); }

/* lower charts row */
.dashlower { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 1100px) { .dashlower { grid-template-columns: 1fr; } }
.dl-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.dl-item:last-child { border-bottom: none; }
.dl-item:hover { background: var(--surface-2); }
.dl-when { font-size: 11px; font-weight: 700; min-width: 48px; color: var(--text-2); }
.dl-when.over { color: var(--danger); } .dl-when.soon { color: var(--warn); }
.dl-title { flex: 1; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* activity feed */
.actfeed { display: flex; flex-direction: column; }
.actitem { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); cursor: pointer; }
.actitem:last-child { border-bottom: none; }
.actitem:hover { background: var(--surface-2); border-radius: 6px; }
.actitem__body { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.actitem__body > span:first-child { font-size: 12.5px; }
.actitem__body b { font-weight: 700; }
.actitem__detail { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* status timeline (drawer) */
.timeline--status .tl-item--st { padding-bottom: 14px; }
.tl-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.tl-item--head .tl-card { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-weak); }
.tl-card .tl-row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-card .tl-detail { font-size: 13px; margin-top: 7px; }
.tl-card .tl-sub { margin-top: 7px; }
.tl-card .tl-by { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.tl-card .tl-by svg { width: 12px; height: 12px; }
.tl-dot--new { background: var(--st-new); } .tl-dot--processing { background: var(--st-processing); }
.tl-dot--waiting { background: var(--st-waiting); } .tl-dot--on_hold { background: var(--st-on_hold); }
.tl-dot--completed { background: var(--st-completed); } .tl-dot--cancelled { background: var(--st-cancelled); }

/* board section wrapper — separates task columns from the panels above */
.board-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.board-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.board-section__title { font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.board-section .boardbar { flex-wrap: nowrap; }
@media (max-width: 620px) { .board-section__head { align-items: stretch; } .board-section .boardbar { flex-wrap: wrap; } }

/* fixed-height columns + hidden scrollbar for the 5s auto-slide rotation */
.bcol { max-height: none; }
.pcol { max-height: none; }
.bcol__body, .pcol__body {
  height: clamp(300px, calc(100vh - 330px), 760px);
  overflow-y: auto; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none;
}
.bcol__body::-webkit-scrollbar, .pcol__body::-webkit-scrollbar { width: 0; height: 0; display: none; }
@media (max-width: 980px) { .bcol__body { height: auto; max-height: 76vh; } }

/* transform-based auto-slide: body clips, inner track translates (reliable, smooth) */
.bcol__body, .pcol__body { overflow: hidden; padding: 0; display: block; }
.bcol__track { display: flex; flex-direction: column; gap: 11px; padding: 12px; transition: transform .7s cubic-bezier(.4,0,.2,1); will-change: transform; }
.pcol__track { display: flex; flex-direction: column; gap: 9px; padding: 10px; transition: transform .7s cubic-bezier(.4,0,.2,1); will-change: transform; }
@media (max-width: 980px) { .bcol__body { height: auto; max-height: 76vh; overflow-y: auto; } .bcol__track { transition: none; transform: none !important; } }
@media (prefers-reduced-motion: reduce) { .bcol__track, .pcol__track { transition: none; } }

/* two-row task layout: [New | In Progress(2col)] on top, Completed full-width below */
.board-top { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; align-items: start; }
.board-top .bcol__body { height: clamp(300px, calc(100vh - 470px), 620px); }
.track--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; align-content: start; }
.bcol--full { margin-top: 16px; }
.bcol--full .bcol__body { height: clamp(200px, 30vh, 360px); }
.track--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 11px; align-content: start; }
@media (max-width: 1100px) { .board-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 980px) { .board-top { grid-template-columns: 1fr; } .track--2col { grid-template-columns: 1fr; } }

/* Left column = New column + Upcoming Project panel, stacked (fills the empty space) */
.bcol-stack { display: flex; flex-direction: column; gap: 16px; align-self: stretch; min-width: 0; min-height: 0; }
.bcol-stack > .bcol { flex: 0 0 auto; }
.bcol-stack > .upj-panel { flex: 1 1 auto; min-height: 200px; display: flex; flex-direction: column; overflow: hidden; }
.upj-panel .panel__body { padding: 0; flex: 1; min-height: 0; overflow: hidden; }
.upj-panel .slidebody { height: auto; }
.upj-panel .panel__title svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; color: var(--accent); }

/* Upcoming Project rows */
.upj-row { display: flex; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.upj-row:last-child { border-bottom: none; }
.upj-date { flex: none; width: 64px; text-align: center; background: var(--accent-weak); color: var(--accent); border-radius: 9px; padding: 5px 4px; }
.upj-date b { display: block; font-size: 12px; font-weight: 800; line-height: 1.25; }
.upj-date span { font-size: 10px; opacity: .85; }
.upj-main { flex: 1; min-width: 0; }
.upj-title { font-weight: 650; font-size: 13px; line-height: 1.3; }
.upj-detail { font-size: 11.5px; color: var(--text-2); margin-top: 2px; line-height: 1.35; }
.upj-del { flex: none; background: none; border: none; color: var(--text-3); cursor: pointer; padding: 3px; border-radius: 6px; opacity: .5; }
.upj-del:hover { opacity: 1; color: var(--danger); background: var(--surface-2); }
.upj-del svg { width: 13px; height: 13px; display: block; }
.upj-empty { padding: 22px 16px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.55; }

/* clickable date fields with a clearly visible calendar picker button */
input[type="date"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .85; cursor: pointer; width: 18px; height: 18px; padding: 2px; border-radius: 5px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--surface-3); }
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.85); }

/* the 3 upper info panels: show ~3 rows, auto-slide the rest (like the columns) */
.slidebody { height: 138px; overflow: hidden; }
.slidetrack { transition: transform .7s cubic-bezier(.4,0,.2,1); will-change: transform; }

/* assignee panel as rows (so it can ticker-rotate like the others) */
.asg-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; }
.asg-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); min-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asg-bar { flex: 1; height: 16px; background: var(--track); border-radius: 20px; overflow: hidden; }
.asg-fill { height: 100%; border-radius: 20px; }
.asg-val { font-size: 12.5px; font-weight: 800; min-width: 20px; text-align: right; }

/* Completed = single horizontal row; overflow rotates left (ticker) */
.bcol--full .bcol__body { height: auto; overflow: hidden; }
.track--row { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 11px; padding: 12px; }
.track--row .tcard-tv { flex: 0 0 300px; }
.track--row .bcol__empty { flex: 1; }
