/**
 * RRV3 Task Management Module - Stylesheet
 *
 * Glassmorphism styling, responsive Kanban lanes, priority badges, checklist progress,
 * and high-contrast dark mode support.
 */

.rrv3-tasks-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
    color: #1e293b;
}

/* Header & Banner */
.rrv3-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.rrv3-tasks-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.rrv3-tasks-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
}

/* KPI Stat Cards Grid */
.rrv3-tasks-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.rrv3-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.rrv3-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rrv3-kpi-icon {
    font-size: 28px;
    line-height: 1;
}

.rrv3-kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rrv3-kpi-val {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.rrv3-kpi-overdue .rrv3-kpi-val {
    color: #dc2626;
}

/* Toolbar & Filters */
.rrv3-tasks-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.rrv3-toolbar-left,
.rrv3-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.rrv3-task-scope-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}

.rrv3-tab-pill {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rrv3-tab-pill.active {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rrv3-view-switcher {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}

.rrv3-view-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rrv3-view-btn.active {
    background: #ffffff;
    color: #0284c7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rrv3-task-search-wrap input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    width: 200px;
    outline: none;
    transition: border-color 0.2s;
}

.rrv3-task-search-wrap input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.rrv3-filter-select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    color: #334155;
    outline: none;
    cursor: pointer;
}

/* Kanban Board Columns */
.rrv3-kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 16px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 24px;
}

.rrv3-kanban-col {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.rrv3-kanban-col-head {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.rrv3-col-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rrv3-col-title-wrap h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.rrv3-col-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-todo { background: #64748b; }
.dot-in-progress { background: #0284c7; }
.dot-review { background: #eab308; }
.dot-done { background: #10b981; }

.rrv3-col-count {
    background: #e2e8f0;
    color: #475569;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
}

.rrv3-col-add-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.rrv3-col-add-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.rrv3-kanban-cards-wrap {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 100px;
    transition: background-color 0.2s;
}

.rrv3-kanban-cards-wrap.drag-over {
    background-color: #f0fdf4;
    border: 2px dashed #10b981;
    border-radius: 8px;
}

.rrv3-cards-empty {
    text-align: center;
    padding: 30px 10px;
    color: #94a3b8;
    font-size: 13px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
}

/* Kanban Task Card */
.rrv3-kanban-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px 12px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.rrv3-kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.rrv3-card-drag-handle {
    position: absolute;
    left: 6px;
    top: 14px;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1;
    cursor: grab;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.rrv3-kanban-card:hover .rrv3-card-drag-handle {
    opacity: 1;
    color: #94a3b8;
}

.rrv3-kanban-card.is-dragging {
    opacity: 0.35;
    transform: scale(0.98);
    border: 2px dashed #0284c7;
    background: #f0f9ff;
    cursor: grabbing;
}

.rrv3-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rrv3-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 6px;
}

.rrv3-card-desc-snippet {
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rrv3-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    margin-top: 4px;
}

.rrv3-card-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rrv3-avatar-group {
    display: flex;
    align-items: center;
}

.rrv3-avatar-stack {
    box-shadow: 0 0 0 1.5px #ffffff;
}

.rrv3-avatar-more {
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    border-color: #cbd5e1;
}

.rrv3-avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #bae6fd;
}

.rrv3-assignee-text {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Multi Assignee Checkbox Box in Modal */
.rrv3-multi-assignee-box {
    max-height: 140px;
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 8px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rrv3-assignee-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.12s ease;
    font-size: 12.5px;
    user-select: none;
}

.rrv3-assignee-checkbox-item:hover {
    background: #e2e8f0;
}

.rrv3-assignee-chk {
    cursor: pointer;
    accent-color: #0284c7;
}

.rrv3-assignee-name-label {
    font-weight: 500;
    color: #1e293b;
}

.rrv3-assignee-role-label {
    font-size: 11px;
    color: #64748b;
    margin-left: auto;
}

/* Assignee Chips Grid in Inspector */
.rrv3-assignee-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rrv3-assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
}

.rrv3-card-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rrv3-card-subtask-badge,
.rrv3-card-comment-badge {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.rrv3-card-due {
    font-size: 11.5px;
    color: #64748b;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 4px;
}

.rrv3-card-due.is-overdue {
    background: #fee2e2;
    color: #dc2626;
    font-weight: 600;
}

.rrv3-card-overdue-tag {
    font-size: 11px;
    font-weight: 700;
    color: #b91c1c;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Priority Badges */
.rrv3-priority-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-urgent { background: #fee2e2; color: #b91c1c; }
.badge-high { background: #ffedd5; color: #c2410c; }
.badge-medium { background: #fef9c3; color: #a16207; }
.badge-low { background: #dcfce7; color: #15803d; }

.stage-todo { background: #f1f5f9; color: #475569; }
.stage-in-progress { background: #e0f2fe; color: #0369a1; }
.stage-review { background: #fef9c3; color: #a16207; }
.stage-done { background: #dcfce7; color: #15803d; }

/* Task Detail Inspector Modal */
.rrv3-task-detail-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}

.rrv3-task-detail-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.rrv3-task-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.rrv3-task-detail-section {
    margin-bottom: 22px;
}

.rrv3-task-detail-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 8px 0;
}

.rrv3-task-desc-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #334155;
}

/* Subtasks & Progress Bar */
.rrv3-checklist-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rrv3-checklist-ratio {
    font-size: 12.5px;
    font-weight: 700;
    color: #0284c7;
}

.rrv3-progress-track {
    height: 7px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.rrv3-progress-bar {
    height: 100%;
    background: #10b981;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rrv3-subtask-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.rrv3-subtask-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
}

.rrv3-subtask-item.is-completed {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.rrv3-subtask-item.is-completed .rrv3-subtask-text {
    text-decoration: line-through;
    color: #94a3b8;
}

.rrv3-subtask-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-size: 13.5px;
}

.rrv3-subtask-del-btn {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
}

.rrv3-subtask-del-btn:hover {
    color: #ef4444;
}

.rrv3-add-subtask-wrap {
    display: flex;
    gap: 8px;
}

.rrv3-add-subtask-wrap input {
    flex: 1;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
}

/* Discussion & Comments */
.rrv3-task-comments-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 240px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.rrv3-comment-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
}

.rrv3-comment-bubble.is-self {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.rrv3-comment-head {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #475569;
    margin-bottom: 4px;
}

.rrv3-comment-body {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.4;
}

.rrv3-add-comment-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rrv3-add-comment-wrap textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
}

/* Sidebar Meta Card */
.rrv3-detail-meta-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
}

.rrv3-meta-item {
    margin-bottom: 12px;
}

.rrv3-meta-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.rrv3-meta-val {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
}

.rrv3-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rrv3-button-block {
    width: 100%;
    justify-content: center;
}

/* ------------------------------------------------------------------------- */
/* DARK MODE SUPPORT                                                         */
/* ------------------------------------------------------------------------- */
html.rrv3-dark-mode .rrv3-tasks-container {
    color: #f1f5f9;
}

html.rrv3-dark-mode .rrv3-tasks-title {
    color: #f8fafc;
}

html.rrv3-dark-mode .rrv3-kpi-card,
html.rrv3-dark-mode .rrv3-tasks-toolbar,
html.rrv3-dark-mode .rrv3-kanban-col,
html.rrv3-dark-mode .rrv3-kanban-card,
html.rrv3-dark-mode .rrv3-subtask-item,
html.rrv3-dark-mode .rrv3-comment-bubble,
html.rrv3-dark-mode .rrv3-detail-meta-card,
html.rrv3-dark-mode .rrv3-task-desc-box,
html.rrv3-dark-mode .rrv3-task-comments-feed {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

html.rrv3-dark-mode .rrv3-kpi-val,
html.rrv3-dark-mode .rrv3-col-title-wrap h3,
html.rrv3-dark-mode .rrv3-card-title,
html.rrv3-dark-mode .rrv3-task-detail-title,
html.rrv3-dark-mode .rrv3-meta-val,
html.rrv3-dark-mode .rrv3-comment-body {
    color: #f8fafc;
}

html.rrv3-dark-mode .rrv3-task-scope-tabs,
html.rrv3-dark-mode .rrv3-view-switcher {
    background: #0f172a;
}

html.rrv3-dark-mode .rrv3-tab-pill,
html.rrv3-dark-mode .rrv3-view-btn {
    color: #94a3b8;
}

html.rrv3-dark-mode .rrv3-tab-pill.active,
html.rrv3-dark-mode .rrv3-view-btn.active {
    background: #334155;
    color: #38bdf8;
}

html.rrv3-dark-mode .rrv3-task-search-wrap input,
html.rrv3-dark-mode .rrv3-filter-select,
html.rrv3-dark-mode .rrv3-add-subtask-wrap input,
html.rrv3-dark-mode .rrv3-add-comment-wrap textarea {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

html.rrv3-dark-mode .rrv3-comment-bubble.is-self {
    background: #064e3b;
    border-color: #047857;
}

.rrv3-sbu-header-tag {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 500;
}

.rrv3-card-sbu-tag {
    font-size: 10.5px;
    background: #f1f5f9;
    color: #475569;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 500;
}

@media (max-width: 900px) {
    .rrv3-task-detail-layout {
        grid-template-columns: 1fr;
    }
}
