/* LMM TaskFlow — taskflow.css v1.0.2 */

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.tf-tabbar {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--lmm-border);
    margin-bottom: 24px; flex-wrap: wrap;
}
.tf-tab {
    padding: 10px 18px; font-size: 13px; font-weight: 600;
    color: var(--lmm-text2); background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    cursor: pointer; font-family: inherit;
    transition: color .15s, border-color .15s;
}
.tf-tab:hover    { color: var(--lmm-text); }
.tf-tab.is-active { color: var(--lmm-green); border-bottom-color: var(--lmm-green); }
.tf-tab-badge {
    background: var(--lmm-danger); color: #fff;
    border-radius: 99px; font-size: 10px; font-weight: 700;
    padding: 1px 5px; margin-left: 4px;
}

/* ── Panels ────────────────────────────────────────────────────────────────── */
.tf-panel { display: none; }
.tf-panel.is-active { display: block; animation: lmm-fadein .15s ease; }

/* ── View switcher ─────────────────────────────────────────────────────────── */
.tf-view-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tf-view-btn {
    padding: 5px 12px; border: 1px solid var(--lmm-border);
    border-radius: 99px; font-size: 12px; font-weight: 600;
    background: none; cursor: pointer; color: var(--lmm-text2);
    font-family: inherit; transition: all .15s;
}
.tf-view-btn:hover    { border-color: var(--lmm-green); color: var(--lmm-green); }
.tf-view-btn.is-active { background: var(--lmm-green); border-color: var(--lmm-green); color: #fff; }

/* ── Status summary pills ──────────────────────────────────────────────────── */
.tf-status-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 24px; }
.tf-status-pill {
    padding: 2px 10px; border-radius: 99px;
    font-size: 11px; font-weight: 700; border: 1px solid; cursor: pointer;
    letter-spacing: .03em;
}

/* ── Filters ───────────────────────────────────────────────────────────────── */
.tf-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.tf-filters .lmm-input { width: auto; flex: 1; min-width: 140px; }

/* ── Task rows ─────────────────────────────────────────────────────────────── */
.tf-task-row {
    background: var(--lmm-surface); border: 1px solid var(--lmm-border);
    border-radius: var(--lmm-radius); padding: 14px 18px;
    margin-bottom: 8px; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.tf-task-row:hover { border-color: var(--lmm-green); background: var(--lmm-surface2); }
.tf-row-urgent   { border-left: 3px solid var(--lmm-danger); }
.tf-row-breached { border-left: 3px solid #e0a352; }
.tf-row-top      { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.tf-row-title    { font-size: 14px; font-weight: 600; color: var(--lmm-text); margin-bottom: 4px; }
.tf-row-meta     { display: flex; gap: 14px; font-size: 12px; color: var(--lmm-text2); flex-wrap: wrap; }
.tf-row-meta-right { margin-left: auto; font-size: 11px; color: var(--lmm-text3); }
.tf-row-brief {
    font-size: 12px; color: var(--lmm-text2); margin-top: 8px;
    font-style: italic; border-left: 2px solid var(--lmm-border);
    padding-left: 10px;
}
.tf-ai-cta { margin-top: 10px; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.tf-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px; font-size: 11px;
    font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    white-space: nowrap;
}
.tf-badge-module  { background: var(--lmm-surface2); color: var(--lmm-text2); border: 1px solid var(--lmm-border); }
.tf-badge-breach  { background: rgba(224,163,82,.15); color: #e0a352; border: 1px solid rgba(224,163,82,.3); }
.tf-badge-ai      { background: rgba(130,100,220,.15); color: #9b7de8; border: 1px solid rgba(130,100,220,.3); }
.tf-badge-open    { background: rgba(224,163,82,.12); color: #e0a352; }
.tf-badge-done    { background: rgba(82,176,67,.12); color: var(--lmm-green); }
.tf-badge-danger  { background: rgba(224,82,82,.12); color: var(--lmm-danger); }

/* ── Empty / loading ───────────────────────────────────────────────────────── */
.tf-empty { text-align: center; padding: 48px 20px; color: var(--lmm-text2); }
.tf-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .7; }
.tf-loading { text-align: center; padding: 40px; color: var(--lmm-text2); }
.tf-results-meta { font-size: 12px; color: var(--lmm-text3); margin-bottom: 8px; }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.tf-pagination { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 14px; }
.tf-page-btn {
    padding: 5px 11px; border: 1px solid var(--lmm-border);
    border-radius: 5px; background: var(--lmm-surface);
    color: var(--lmm-text2); font-size: 12px; cursor: pointer;
    font-family: inherit; transition: all .15s;
}
.tf-page-btn:hover    { border-color: var(--lmm-green); color: var(--lmm-green); }
.tf-page-btn.is-active { background: var(--lmm-green); border-color: var(--lmm-green); color: #fff; }

/* ── AI approval cards ─────────────────────────────────────────────────────── */
.tf-ai-card {
    background: var(--lmm-surface); border: 1px solid var(--lmm-border);
    border-left: 3px solid #9b7de8;
    border-radius: var(--lmm-radius); padding: 18px 20px; margin-bottom: 12px;
}
.tf-ai-card-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.tf-ai-task-title { font-size: 14px; font-weight: 600; color: var(--lmm-text); }
.tf-ai-recommendation {
    background: var(--lmm-surface2); border: 1px solid var(--lmm-border);
    border-radius: var(--lmm-radius-sm); padding: 12px 16px; margin: 10px 0;
}
.tf-ai-rec-label    { font-size: 13px; margin-bottom: 6px; color: var(--lmm-text); }
.tf-ai-action-plain { font-size: 14px; font-weight: 600; color: var(--lmm-text); margin-bottom: 6px; }
.tf-ai-reasoning    { font-size: 12px; color: var(--lmm-text2); line-height: 1.6; margin-bottom: 6px; }
.tf-ai-draft {
    background: var(--lmm-surface); border: 1px solid var(--lmm-border);
    border-radius: 4px; padding: 8px 12px; font-size: 12px;
    color: var(--lmm-text2); margin-bottom: 6px; font-style: italic;
}
.tf-ai-risk          { font-size: 11px; font-weight: 700; color: var(--lmm-text3); text-transform: uppercase; }
.tf-ai-risk-high     { color: var(--lmm-danger); }
.tf-ai-actions       { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }

/* Approve / reject buttons */
.tf-btn-approve {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; background: var(--lmm-green); color: #fff;
    border: none; border-radius: var(--lmm-radius-sm);
    font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: background .15s;
}
.tf-btn-approve:hover { background: var(--lmm-green-dim); }
.tf-btn-reject {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; background: rgba(224,82,82,.1); color: var(--lmm-danger);
    border: 1px solid rgba(224,82,82,.3); border-radius: var(--lmm-radius-sm);
    font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: background .15s;
}
.tf-btn-reject:hover { background: rgba(224,82,82,.2); }
.tf-btn-ai {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; background: rgba(130,100,220,.1); color: #9b7de8;
    border: 1px solid rgba(130,100,220,.3); border-radius: var(--lmm-radius-sm);
    font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: background .15s;
}
.tf-btn-ai:hover { background: rgba(130,100,220,.2); }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.tf-modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    left: var(--lmm-sidebar-w, 240px);
    background: rgba(0,0,0,.6);
    z-index: 9999; display: none; align-items: center;
    justify-content: center; padding: 24px; backdrop-filter: blur(3px);
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .tf-modal-overlay { left: 0; }
}
.tf-modal-overlay.is-open { display: flex; }
.tf-modal {
    background: var(--lmm-surface); border: 1px solid var(--lmm-border);
    border-radius: 12px; width: 100%; max-width: 620px;
    max-height: 90vh; overflow-y: auto; box-shadow: var(--lmm-shadow);
}
.tf-modal-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 20px 24px; border-bottom: 1px solid var(--lmm-border);
    position: sticky; top: 0; background: var(--lmm-surface); z-index: 1;
}
.tf-modal-title { font-size: 16px; font-weight: 700; color: var(--lmm-text); }
.tf-modal-close {
    width: 28px; height: 28px; display: flex; align-items: center;
    justify-content: center; border-radius: 6px; color: var(--lmm-text3);
    font-size: 14px; background: none; border: none; cursor: pointer;
    transition: background .15s;
}
.tf-modal-close:hover { background: var(--lmm-surface3); color: var(--lmm-text); }
.tf-modal-body { padding: 20px 24px; }

/* ── Task detail inside modal ──────────────────────────────────────────────── */
.tf-detail-grid { display: grid; gap: 0; margin-bottom: 16px; }
.tf-detail-row {
    display: grid; grid-template-columns: 130px 1fr;
    gap: 10px; padding: 8px 0;
    border-bottom: 1px solid var(--lmm-border); align-items: start;
}
.tf-detail-row:last-child { border-bottom: none; }
.tf-detail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--lmm-text2); padding-top: 2px; }
.tf-detail-value { font-size: 13px; color: var(--lmm-text); }
.tf-section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--lmm-text3); margin: 18px 0 6px;
}
.tf-brief-box {
    background: var(--lmm-surface2); border: 1px solid var(--lmm-border);
    border-left: 3px solid #9b7de8; border-radius: var(--lmm-radius-sm);
    padding: 10px 14px; font-size: 13px; line-height: 1.6;
    color: var(--lmm-text2); margin-bottom: 12px; font-style: italic;
}
.tf-context-box {
    background: var(--lmm-surface2); border: 1px solid var(--lmm-border);
    border-radius: var(--lmm-radius-sm); padding: 10px 14px;
    font-size: 12px; font-family: var(--lmm-mono); white-space: pre-wrap;
    word-break: break-word; color: var(--lmm-text2);
    max-height: 140px; overflow-y: auto; margin-bottom: 12px;
}
.tf-status-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tf-status-change-btn {
    padding: 5px 12px; border-radius: 5px; font-size: 12px; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: all .15s;
    background: none;
}
.tf-status-change-btn.is-active { color: #fff !important; }

/* ── Comments thread ───────────────────────────────────────────────────────── */
.tf-comments { margin-bottom: 10px; }
.tf-comment { padding: 8px 0; border-bottom: 1px solid var(--lmm-border); }
.tf-comment:last-child { border-bottom: none; }
.tf-comment-internal {
    background: var(--lmm-surface2); border-radius: var(--lmm-radius-sm);
    padding: 8px 12px; margin-bottom: 4px;
}
.tf-comment-meta { font-size: 11px; color: var(--lmm-text3); margin-bottom: 3px; }
.tf-comment-body { font-size: 13px; color: var(--lmm-text); white-space: pre-wrap; }

/* ── Activity log ──────────────────────────────────────────────────────────── */
.tf-log-list { margin-top: 6px; }
.tf-log-item {
    display: flex; gap: 10px; padding: 7px 0;
    border-bottom: 1px solid var(--lmm-border); font-size: 12px;
    color: var(--lmm-text2);
}
.tf-log-item:last-child { border-bottom: none; }
.tf-log-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--lmm-green); margin-top: 4px; flex-shrink: 0;
}

/* ── Msg banner ────────────────────────────────────────────────────────────── */
.tf-msg {
    padding: 10px 14px; border-radius: var(--lmm-radius-sm);
    font-size: 13px; margin: 8px 0; display: none;
}
.tf-msg.show { display: block; }
.tf-msg-success { background: rgba(82,176,67,.12); border: 1px solid rgba(82,176,67,.3); color: var(--lmm-green-light); }
.tf-msg-error   { background: rgba(224,82,82,.12); border: 1px solid rgba(224,82,82,.3); color: var(--lmm-danger); }
.tf-msg-warn    { background: rgba(224,163,82,.12); border: 1px solid rgba(224,163,82,.3); color: #e0a352; }

/* ── tf-modal-overlay is fully self-contained — no portal.css dependency ── */
/* These rules are in the same block as the definition above (line ~157)     */
/* so there is nothing to override here. Clean slate.                         */

/* ── Admin filter bar ─────────────────────────────────────────────────────── */
.tf-adm-filters {
    display: flex; gap: 10px; flex-wrap: wrap;
    align-items: center; margin-bottom: 16px;
}
.tf-adm-filters .lmm-input { width: auto; flex: 1; min-width: 130px; max-width: 220px; }

/* ── Audit log task rows ──────────────────────────────────────────────────── */
.tf-log-task-row:hover td { background: var(--lmm-surface2); }
.tf-log-task-row td { transition: background .1s; }
