/* ============================================================
   Task Center — Design System CSS
   Modern, minimal, premium UI inspired by Linear/Notion/To Do
   ============================================================ */

/* ── Design Tokens ── */
:root {
    /* Primary palette */
    --tc-accent: #6366f1;
    --tc-accent-light: #818cf8;
    --tc-accent-bg: #eef2ff;
    --tc-accent-hover: #4f46e5;

    /* Semantic colors */
    --tc-success: #22c55e;
    --tc-success-bg: #f0fdf4;
    --tc-warning: #f59e0b;
    --tc-warning-bg: #fffbeb;
    --tc-danger: #ef4444;
    --tc-danger-bg: #fef2f2;
    --tc-info: #3b82f6;
    --tc-info-bg: #eff6ff;
    --tc-purple: #8b5cf6;
    --tc-purple-bg: #f5f3ff;

    /* Neutrals */
    --tc-text-primary: #0f172a;
    --tc-text-secondary: #475569;
    --tc-text-muted: #94a3b8;
    --tc-text-faint: #cbd5e1;
    --tc-border: #e2e8f0;
    --tc-border-light: #f1f5f9;
    --tc-bg-page: #f8fafc;
    --tc-bg-card: #ffffff;
    --tc-bg-hover: #f8fafc;
    --tc-bg-subtle: #f1f5f9;

    /* Spacing */
    --tc-gap-xs: 4px;
    --tc-gap-sm: 8px;
    --tc-gap-md: 12px;
    --tc-gap-lg: 16px;
    --tc-gap-xl: 20px;
    --tc-gap-2xl: 24px;

    /* Radius */
    --tc-radius-sm: 6px;
    --tc-radius-md: 10px;
    --tc-radius-lg: 12px;
    --tc-radius-xl: 16px;
    --tc-radius-full: 9999px;

    /* Shadows */
    --tc-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --tc-shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --tc-shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --tc-shadow-hover: 0 4px 12px rgba(99,102,241,0.10);

    /* Transitions */
    --tc-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --tc-transition-fast: 120ms ease;
    --tc-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --tc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --tc-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ── Animations ── */
@keyframes tc-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes tc-slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tc-slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tc-scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes tc-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
@keyframes tc-countUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tc-shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}
@keyframes tc-checkmark {
    0%   { transform: scale(0); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ── Page Container ── */
.tc-page {
    padding: var(--tc-gap-xl);
    max-width: 1400px;
    margin: 0 auto;
    font-family: var(--tc-font);
    animation: tc-fadeIn 300ms ease;
}

/* ── Header ── */
.tc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--tc-gap-xl);
    flex-wrap: wrap;
    gap: var(--tc-gap-md);
}
.tc-header-left {
    display: flex;
    align-items: center;
    gap: var(--tc-gap-md);
}
.tc-header-right {
    display: flex;
    gap: var(--tc-gap-sm);
    flex-wrap: wrap;
}
.tc-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--tc-text-primary);
    letter-spacing: -0.01em;
}
.tc-subtitle {
    font-size: 0.85rem;
    color: var(--tc-text-muted);
    margin: 0;
}
.tc-back-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--tc-radius-md);
    background: var(--tc-bg-card);
    border: 1px solid var(--tc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--tc-text-secondary);
    transition: all var(--tc-transition);
    cursor: pointer;
    font-size: 0.85rem;
}
.tc-back-btn:hover {
    background: var(--tc-bg-hover);
    border-color: var(--tc-accent);
    color: var(--tc-accent);
    box-shadow: var(--tc-shadow-sm);
}

/* ── View Switcher (segmented control) ── */
.tc-view-switcher {
    display: inline-flex;
    background: var(--tc-bg-subtle);
    border-radius: var(--tc-radius-md);
    padding: 3px;
    gap: 2px;
}
.tc-view-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--tc-text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--tc-transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.tc-view-btn:hover {
    color: var(--tc-text-primary);
    background: rgba(255,255,255,0.6);
}
.tc-view-btn.active {
    background: var(--tc-bg-card);
    color: var(--tc-accent);
    font-weight: 600;
    box-shadow: var(--tc-shadow-sm);
}

/* ── Action Buttons ── */
.tc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--tc-radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--tc-transition);
    white-space: nowrap;
    text-decoration: none;
    font-family: var(--tc-font);
    line-height: 1.3;
}
.tc-btn:focus-visible {
    outline: 2px solid var(--tc-accent);
    outline-offset: 2px;
}
.tc-btn-primary {
    background: var(--tc-accent);
    color: #fff;
    border-color: var(--tc-accent);
}
.tc-btn-primary:hover {
    background: var(--tc-accent-hover);
    box-shadow: var(--tc-shadow-hover);
    transform: translateY(-1px);
}
.tc-btn-secondary {
    background: var(--tc-bg-card);
    color: var(--tc-text-secondary);
    border-color: var(--tc-border);
}
.tc-btn-secondary:hover {
    border-color: var(--tc-accent);
    color: var(--tc-accent);
    background: var(--tc-accent-bg);
}
.tc-btn-ghost {
    background: transparent;
    color: var(--tc-text-muted);
    border: none;
    padding: 6px 10px;
}
.tc-btn-ghost:hover {
    color: var(--tc-accent);
    background: var(--tc-accent-bg);
}
.tc-btn-danger {
    background: transparent;
    color: var(--tc-text-muted);
    border: 1px solid var(--tc-border);
}
.tc-btn-danger:hover {
    color: var(--tc-danger);
    border-color: var(--tc-danger);
    background: var(--tc-danger-bg);
}
.tc-btn-success {
    background: transparent;
    color: var(--tc-text-muted);
    border: 1px solid var(--tc-border);
}
.tc-btn-success:hover {
    color: var(--tc-success);
    border-color: var(--tc-success);
    background: var(--tc-success-bg);
}
.tc-btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
}
.tc-btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--tc-radius-sm);
}

/* ── KPI Cards ── */
.tc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--tc-gap-md);
    margin-bottom: var(--tc-gap-xl);
}
.tc-kpi-card {
    background: var(--tc-bg-card);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    padding: 16px 20px;
    text-align: center;
    transition: all var(--tc-transition);
    animation: tc-scaleIn 400ms ease backwards;
    position: relative;
    overflow: hidden;
}
.tc-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--tc-radius-lg) var(--tc-radius-lg) 0 0;
}
.tc-kpi-card:hover {
    box-shadow: var(--tc-shadow-md);
    transform: translateY(-2px);
}
.tc-kpi-card:nth-child(1) { animation-delay: 0ms; }
.tc-kpi-card:nth-child(2) { animation-delay: 60ms; }
.tc-kpi-card:nth-child(3) { animation-delay: 120ms; }
.tc-kpi-card:nth-child(4) { animation-delay: 180ms; }
.tc-kpi-card:nth-child(5) { animation-delay: 240ms; }
.tc-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    animation: tc-countUp 500ms ease backwards;
    font-variant-numeric: tabular-nums;
}
.tc-kpi-label {
    font-size: 0.72rem;
    color: var(--tc-text-muted);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
/* KPI color variants */
.tc-kpi-card.blue    .tc-kpi-value { color: var(--tc-info); }
.tc-kpi-card.blue::before    { background: var(--tc-info); }
.tc-kpi-card.green   .tc-kpi-value { color: var(--tc-success); }
.tc-kpi-card.green::before   { background: var(--tc-success); }
.tc-kpi-card.red     .tc-kpi-value { color: var(--tc-danger); }
.tc-kpi-card.red::before     { background: var(--tc-danger); }
.tc-kpi-card.orange  .tc-kpi-value { color: var(--tc-warning); }
.tc-kpi-card.orange::before  { background: var(--tc-warning); }
.tc-kpi-card.purple  .tc-kpi-value { color: var(--tc-purple); }
.tc-kpi-card.purple::before  { background: var(--tc-purple); }

/* ── Filter Bar ── */
.tc-filter-bar {
    display: flex;
    gap: var(--tc-gap-sm);
    margin-bottom: var(--tc-gap-lg);
    flex-wrap: wrap;
    align-items: center;
}
.tc-search {
    position: relative;
    flex: 0 1 260px;
    min-width: 180px;
}
.tc-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 0.85rem;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    background: var(--tc-bg-card);
    transition: border-color var(--tc-transition), box-shadow var(--tc-transition);
}
.tc-search input:focus {
    outline: none;
    border-color: var(--tc-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}
.tc-search input::placeholder {
    color: var(--tc-text-faint);
}
.tc-search .tc-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tc-text-faint);
    font-size: 0.82rem;
    pointer-events: none;
}
.tc-filter-select {
    padding: 8px 30px 8px 10px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 0.82rem;
    font-family: var(--tc-font);
    color: var(--tc-text-secondary);
    background: var(--tc-bg-card);
    cursor: pointer;
    transition: border-color var(--tc-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.tc-filter-select:focus {
    outline: none;
    border-color: var(--tc-accent);
}
.tc-filter-select:not([value=""]) {
    border-color: var(--tc-accent-light);
    color: var(--tc-accent);
    background-color: var(--tc-accent-bg);
}
.tc-filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--tc-text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--tc-radius-sm);
    transition: background var(--tc-transition);
    user-select: none;
}
.tc-filter-toggle:hover {
    background: var(--tc-bg-subtle);
}
.tc-filter-toggle input[type="checkbox"] {
    accent-color: var(--tc-accent);
    width: 15px;
    height: 15px;
}

/* ── Quick Add ── */
.tc-quick-add {
    margin-bottom: var(--tc-gap-lg);
    position: relative;
}
.tc-quick-add input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px dashed var(--tc-border);
    border-radius: var(--tc-radius-md);
    font-size: 0.9rem;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    background: var(--tc-bg-card);
    transition: all var(--tc-transition);
}
.tc-quick-add input:focus {
    outline: none;
    border-style: solid;
    border-color: var(--tc-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}
.tc-quick-add input::placeholder {
    color: var(--tc-text-faint);
}
.tc-quick-add .tc-quick-add-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tc-accent-light);
    font-size: 0.9rem;
    pointer-events: none;
}
.tc-quick-add-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: var(--tc-text-faint);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--tc-transition);
}
.tc-quick-add input:focus ~ .tc-quick-add-hint {
    opacity: 1;
}

/* ── Task List (card rows) ── */
.tc-task-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--tc-bg-card);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    overflow: hidden;
}
.tc-task-row {
    display: flex;
    align-items: center;
    gap: var(--tc-gap-md);
    padding: 12px 16px;
    background: var(--tc-bg-card);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all var(--tc-transition);
    animation: tc-slideUp 300ms ease backwards;
    position: relative;
}
.tc-task-row:not(:last-child) {
    border-bottom: 1px solid var(--tc-border-light);
}
.tc-task-row:hover {
    background: var(--tc-bg-hover);
    box-shadow: var(--tc-shadow-sm);
}
.tc-task-row:hover .tc-task-actions {
    opacity: 1;
    transform: translateX(0);
}
/* Priority left border */
.tc-task-row.prio-critical { border-left-color: var(--tc-danger); }
.tc-task-row.prio-high     { border-left-color: var(--tc-warning); }
.tc-task-row.prio-normal   { border-left-color: var(--tc-info); }
.tc-task-row.prio-low      { border-left-color: var(--tc-text-faint); }
/* Overdue background */
.tc-task-row.overdue {
    background: #fef8f8;
}
.tc-task-row.overdue:hover {
    background: #fef2f2;
}

/* Stagger animation */
.tc-task-row:nth-child(1)  { animation-delay: 0ms; }
.tc-task-row:nth-child(2)  { animation-delay: 30ms; }
.tc-task-row:nth-child(3)  { animation-delay: 60ms; }
.tc-task-row:nth-child(4)  { animation-delay: 90ms; }
.tc-task-row:nth-child(5)  { animation-delay: 120ms; }
.tc-task-row:nth-child(6)  { animation-delay: 150ms; }
.tc-task-row:nth-child(7)  { animation-delay: 180ms; }
.tc-task-row:nth-child(8)  { animation-delay: 210ms; }
.tc-task-row:nth-child(9)  { animation-delay: 240ms; }
.tc-task-row:nth-child(10) { animation-delay: 270ms; }
.tc-task-row:nth-child(n+11) { animation-delay: 300ms; }

.tc-task-content {
    flex: 1;
    min-width: 0;
}
.tc-task-title {
    font-weight: 600;
    color: var(--tc-text-primary);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.tc-task-meta {
    display: flex;
    gap: var(--tc-gap-sm);
    align-items: center;
    margin-top: 3px;
    flex-wrap: wrap;
}
.tc-task-ref {
    font-family: var(--tc-font-mono);
    font-size: 0.72rem;
    color: var(--tc-accent);
    font-weight: 600;
}
.tc-task-detail {
    font-size: 0.75rem;
    color: var(--tc-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.tc-task-detail i {
    font-size: 0.68rem;
}
.tc-task-info {
    display: flex;
    align-items: center;
    gap: var(--tc-gap-md);
    flex-shrink: 0;
}
.tc-task-actions {
    display: flex;
    gap: var(--tc-gap-xs);
    opacity: 0;
    transform: translateX(8px);
    transition: all var(--tc-transition);
    flex-shrink: 0;
}

/* ── Badges ── */
.tc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--tc-radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}
.tc-badge .tc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Status badges */
.tc-badge-todo       { background: #f1f5f9; color: #64748b; }
.tc-badge-todo .tc-dot       { background: #94a3b8; }
.tc-badge-in-progress { background: #dbeafe; color: #2563eb; }
.tc-badge-in-progress .tc-dot { background: #3b82f6; }
.tc-badge-review     { background: #e0e7ff; color: #4338ca; }
.tc-badge-review .tc-dot     { background: #6366f1; }
.tc-badge-blocked    { background: #fee2e2; color: #dc2626; }
.tc-badge-blocked .tc-dot    { background: #ef4444; }
.tc-badge-done       { background: #dcfce7; color: #16a34a; }
.tc-badge-done .tc-dot       { background: #22c55e; }
.tc-badge-cancelled  { background: #f1f5f9; color: #94a3b8; }
.tc-badge-cancelled .tc-dot  { background: #cbd5e1; }
.tc-badge-waiting    { background: #fef3c7; color: #d97706; }
.tc-badge-waiting .tc-dot    { background: #f59e0b; }
.tc-badge-on-hold    { background: #fce7f3; color: #db2777; }
.tc-badge-on-hold .tc-dot    { background: #ec4899; }
.tc-badge-testing    { background: #e0f2fe; color: #0284c7; }
.tc-badge-testing .tc-dot    { background: #0ea5e9; }
.tc-badge-archived   { background: #f1f5f9; color: #94a3b8; }
.tc-badge-archived .tc-dot   { background: #cbd5e1; }

/* Priority badges */
.tc-badge-critical  { background: #fde2e2; color: #b91c1c; }
.tc-badge-critical .tc-dot  { background: #dc2626; animation: tc-pulse 1.5s ease infinite; }
.tc-badge-high      { background: #ffedcc; color: #b45309; }
.tc-badge-high .tc-dot      { background: #f59e0b; }
.tc-badge-normal    { background: #dbeafe; color: #1d4ed8; }
.tc-badge-normal .tc-dot    { background: #3b82f6; }
.tc-badge-low       { background: #f1f5f9; color: #64748b; }
.tc-badge-low .tc-dot       { background: #94a3b8; }

/* Overdue chip */
.tc-overdue-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--tc-danger-bg);
    color: var(--tc-danger);
    border-radius: var(--tc-radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    animation: tc-pulse 2s ease infinite;
}

/* ── Avatar / User Initials ── */
.tc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}
.tc-avatar-sm {
    width: 22px;
    height: 22px;
    font-size: 0.58rem;
}
.tc-avatar-lg {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
}

/* ── Kanban ── */
.tc-kanban {
    display: flex;
    gap: var(--tc-gap-lg);
    overflow-x: auto;
    padding-bottom: var(--tc-gap-lg);
    min-height: calc(100vh - 200px);
    align-items: flex-start;
}
.tc-kanban-col {
    min-width: 280px;
    max-width: 320px;
    flex: 1;
    background: var(--tc-bg-subtle);
    border-radius: var(--tc-radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
    animation: tc-scaleIn 400ms ease backwards;
}
.tc-kanban-col:nth-child(1) { animation-delay: 0ms; }
.tc-kanban-col:nth-child(2) { animation-delay: 60ms; }
.tc-kanban-col:nth-child(3) { animation-delay: 120ms; }
.tc-kanban-col:nth-child(4) { animation-delay: 180ms; }
.tc-kanban-col:nth-child(5) { animation-delay: 240ms; }
.tc-kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 2px solid transparent;
    flex-shrink: 0;
}
.tc-kanban-col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--tc-text-primary);
}
.tc-kanban-col-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: var(--tc-radius-full);
    background: rgba(0,0,0,0.06);
    color: var(--tc-text-secondary);
}
.tc-kanban-col-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--tc-gap-sm);
    display: flex;
    flex-direction: column;
    gap: var(--tc-gap-sm);
}
.tc-kanban-col-body::-webkit-scrollbar {
    width: 4px;
}
.tc-kanban-col-body::-webkit-scrollbar-track {
    background: transparent;
}
.tc-kanban-col-body::-webkit-scrollbar-thumb {
    background: var(--tc-border);
    border-radius: 4px;
}

/* Kanban Card */
.tc-kanban-card {
    background: var(--tc-bg-card);
    border-radius: var(--tc-radius-md);
    padding: 12px 14px;
    box-shadow: var(--tc-shadow-sm);
    cursor: grab;
    transition: all var(--tc-transition);
    border: 1px solid transparent;
    animation: tc-slideUp 250ms ease backwards;
}
.tc-kanban-card:hover {
    box-shadow: var(--tc-shadow-md);
    transform: translateY(-2px);
    border-color: var(--tc-border);
}
.tc-kanban-card:active {
    cursor: grabbing;
    box-shadow: var(--tc-shadow-lg);
    transform: scale(1.02);
    opacity: 0.9;
}
.tc-kanban-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}
.tc-kanban-card .tc-task-title {
    font-size: 0.85rem;
    margin-bottom: 8px;
    white-space: normal;
    line-height: 1.4;
}
.tc-kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

/* Drop zone visual */
.tc-kanban-col-body.dragover {
    background: rgba(99,102,241,0.04);
    border: 2px dashed var(--tc-accent-light);
    border-radius: var(--tc-radius-md);
}

/* ── Form Panel (TaskForm) ── */
.tc-form-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--tc-gap-xl);
    align-items: start;
}
@media (max-width: 900px) {
    .tc-form-grid {
        grid-template-columns: 1fr;
    }
}
.tc-form-panel {
    background: var(--tc-bg-card);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    padding: var(--tc-gap-xl);
    animation: tc-slideUp 300ms ease backwards;
}
.tc-form-panel + .tc-form-panel {
    animation-delay: 80ms;
}
.tc-form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 var(--tc-gap-md);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--tc-text-primary);
}
.tc-form-section-title i {
    color: var(--tc-accent);
    font-size: 0.82rem;
}
.tc-form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tc-text-secondary);
    margin-bottom: 4px;
}
.tc-form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 0.88rem;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    transition: border-color var(--tc-transition), box-shadow var(--tc-transition);
    background: var(--tc-bg-card);
}
.tc-form-input:focus {
    outline: none;
    border-color: var(--tc-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}
.tc-form-input::placeholder {
    color: var(--tc-text-faint);
}
/* Title input — big, borderless, Notion style */
.tc-form-title-input {
    width: 100%;
    padding: 4px 0;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    transition: border-color var(--tc-transition);
    background: transparent;
}
.tc-form-title-input:focus {
    outline: none;
    border-bottom-color: var(--tc-accent);
}
.tc-form-title-input::placeholder {
    color: var(--tc-text-faint);
    font-weight: 400;
}
.tc-form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 0.85rem;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    resize: vertical;
    min-height: 80px;
    transition: border-color var(--tc-transition), box-shadow var(--tc-transition);
}
.tc-form-textarea:focus {
    outline: none;
    border-color: var(--tc-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}
.tc-form-select {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 0.85rem;
    font-family: var(--tc-font);
    color: var(--tc-text-secondary);
    background: var(--tc-bg-card);
    cursor: pointer;
    transition: border-color var(--tc-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.tc-form-select:focus {
    outline: none;
    border-color: var(--tc-accent);
}
.tc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--tc-gap-md);
}
.tc-form-group {
    margin-bottom: var(--tc-gap-md);
}

/* ── Subtask Items ── */
.tc-subtask-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tc-subtask-item {
    display: flex;
    align-items: center;
    gap: var(--tc-gap-sm);
    padding: 6px 8px;
    border-radius: var(--tc-radius-sm);
    transition: background var(--tc-transition);
    animation: tc-slideUp 200ms ease backwards;
}
.tc-subtask-item:hover {
    background: var(--tc-bg-subtle);
}
.tc-subtask-check {
    width: 18px;
    height: 18px;
    accent-color: var(--tc-accent);
    cursor: pointer;
    flex-shrink: 0;
}
.tc-subtask-label {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    padding: 2px 4px;
    border-radius: 4px;
    transition: all var(--tc-transition);
}
.tc-subtask-label:focus {
    outline: none;
    background: var(--tc-bg-card);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.tc-subtask-item.done .tc-subtask-label {
    text-decoration: line-through;
    color: var(--tc-text-muted);
}
.tc-subtask-remove {
    border: none;
    background: none;
    color: var(--tc-text-faint);
    cursor: pointer;
    opacity: 0;
    transition: all var(--tc-transition);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.78rem;
}
.tc-subtask-item:hover .tc-subtask-remove {
    opacity: 1;
}
.tc-subtask-remove:hover {
    color: var(--tc-danger);
    background: var(--tc-danger-bg);
}

/* ── Progress Bar ── */
.tc-progress {
    width: 100%;
    height: 6px;
    background: var(--tc-bg-subtle);
    border-radius: var(--tc-radius-full);
    overflow: hidden;
}
.tc-progress-fill {
    height: 100%;
    border-radius: var(--tc-radius-full);
    transition: width var(--tc-transition-slow), background var(--tc-transition);
    min-width: 2px;
}
.tc-progress-mini {
    height: 4px;
    width: 50px;
    display: inline-block;
    vertical-align: middle;
}

/* ── Comments ── */
.tc-comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--tc-gap-sm);
    margin-bottom: var(--tc-gap-md);
}
.tc-comment {
    padding: 10px 14px;
    background: var(--tc-bg-subtle);
    border-radius: var(--tc-radius-md);
    animation: tc-slideUp 200ms ease backwards;
}
.tc-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.tc-comment-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tc-text-secondary);
}
.tc-comment-time {
    font-size: 0.72rem;
    color: var(--tc-text-muted);
}
.tc-comment-text {
    font-size: 0.85rem;
    color: var(--tc-text-primary);
    line-height: 1.5;
}
.tc-comment-input-row {
    display: flex;
    gap: var(--tc-gap-sm);
}
.tc-comment-input-row input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-full);
    font-size: 0.85rem;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    transition: border-color var(--tc-transition);
}
.tc-comment-input-row input:focus {
    outline: none;
    border-color: var(--tc-accent);
}

/* ── Activity Timeline ── */
.tc-timeline {
    max-height: 300px;
    overflow-y: auto;
}
.tc-timeline-item {
    display: flex;
    gap: var(--tc-gap-sm);
    padding: 6px 0;
    border-bottom: 1px solid var(--tc-border-light);
    font-size: 0.78rem;
}
.tc-timeline-item:last-child {
    border-bottom: none;
}
.tc-timeline-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.62rem;
    background: var(--tc-bg-subtle);
    color: var(--tc-text-muted);
}
.tc-timeline-content {
    flex: 1;
    color: var(--tc-text-secondary);
    line-height: 1.5;
}
.tc-timeline-time {
    font-size: 0.72rem;
    color: var(--tc-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Metadata Card ── */
.tc-meta-card {
    background: var(--tc-bg-subtle);
    border: 1px solid var(--tc-border-light);
    border-radius: var(--tc-radius-md);
    padding: 14px 16px;
    font-size: 0.78rem;
    color: var(--tc-text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tc-meta-card strong {
    color: var(--tc-text-secondary);
}

/* ── Section blocks (MyTasks) ── */
.tc-section {
    background: var(--tc-bg-card);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    padding: var(--tc-gap-lg) var(--tc-gap-xl);
    animation: tc-slideUp 300ms ease backwards;
}
.tc-section-header {
    display: flex;
    align-items: center;
    gap: var(--tc-gap-sm);
    margin-bottom: var(--tc-gap-md);
}
.tc-section-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}
.tc-section-count {
    padding: 1px 10px;
    border-radius: var(--tc-radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}
.tc-section-body {
    display: flex;
    flex-direction: column;
    gap: var(--tc-gap-sm);
}

/* ── Empty State ── */
.tc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    animation: tc-fadeIn 400ms ease;
}
.tc-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}
.tc-empty-text {
    font-size: 0.9rem;
    color: var(--tc-text-muted);
    margin-bottom: 16px;
}
.tc-empty-sub {
    font-size: 0.8rem;
    color: var(--tc-text-faint);
}

/* ── Count badge ── */
.tc-count {
    margin-top: var(--tc-gap-sm);
    font-size: 0.8rem;
    color: var(--tc-text-muted);
    text-align: right;
}

/* ── Greeting (MyTasks) ── */
.tc-greeting {
    display: flex;
    align-items: center;
    gap: var(--tc-gap-md);
}
.tc-greeting-text h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--tc-text-primary);
}
.tc-greeting-text p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--tc-text-muted);
}

/* ── Overdue tag badge ── */
.tc-overdue-tag {
    background: var(--tc-danger-bg);
    color: var(--tc-danger);
    padding: 3px 10px;
    border-radius: var(--tc-radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .tc-page {
        padding: var(--tc-gap-md);
    }
    .tc-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .tc-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tc-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .tc-search {
        flex: 1 1 100%;
    }
    .tc-task-info {
        display: none;
    }
    .tc-kanban {
        flex-direction: column;
    }
    .tc-kanban-col {
        max-width: 100%;
        min-width: 100%;
        max-height: none;
    }
    .tc-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Shorthand aliases (used by JS pages) ── */
.tc-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 0.88rem;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    transition: border-color var(--tc-transition), box-shadow var(--tc-transition);
    background: var(--tc-bg-card);
    box-sizing: border-box;
}
.tc-input:focus {
    outline: none;
    border-color: var(--tc-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}
.tc-input::placeholder { color: var(--tc-text-faint); }

.tc-select {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 0.85rem;
    font-family: var(--tc-font);
    color: var(--tc-text-secondary);
    background: var(--tc-bg-card);
    cursor: pointer;
    transition: border-color var(--tc-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    box-sizing: border-box;
}
.tc-select:focus {
    outline: none;
    border-color: var(--tc-accent);
}

.tc-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    font-size: 0.85rem;
    font-family: var(--tc-font);
    color: var(--tc-text-primary);
    resize: vertical;
    min-height: 60px;
    transition: border-color var(--tc-transition), box-shadow var(--tc-transition);
    box-sizing: border-box;
}
.tc-textarea:focus {
    outline: none;
    border-color: var(--tc-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.10);
}

.tc-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tc-text-secondary);
    margin-bottom: 4px;
}

.tc-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--tc-accent);
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Form sections (TaskForm) ── */
.tc-form-section {
    background: var(--tc-bg-card);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    padding: var(--tc-gap-xl);
    margin-bottom: var(--tc-gap-lg);
    animation: tc-slideUp 300ms ease backwards;
}
.tc-form-section + .tc-form-section { animation-delay: 60ms; }
.tc-form-section + .tc-form-section + .tc-form-section { animation-delay: 120ms; }

.tc-form-panel .tc-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--tc-gap-md);
}
.tc-form-full {
    grid-column: 1 / -1;
}
@media (max-width: 640px) {
    .tc-form-panel .tc-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Subtask row (TaskForm shorthand) ── */
.tc-subtask {
    display: flex;
    align-items: center;
    gap: var(--tc-gap-sm);
    padding: 6px 8px;
    border-radius: var(--tc-radius-sm);
    transition: background var(--tc-transition);
    animation: tc-slideUp 200ms ease backwards;
}
.tc-subtask:hover {
    background: var(--tc-bg-subtle);
}
.tc-subtask-done {
    text-decoration: line-through;
    color: var(--tc-text-muted);
}

/* ── Comment layout (TaskForm) ── */
.tc-comment {
    display: flex;
    gap: var(--tc-gap-sm);
    padding: 10px 14px;
    background: var(--tc-bg-subtle);
    border-radius: var(--tc-radius-md);
    animation: tc-slideUp 200ms ease backwards;
    margin-bottom: var(--tc-gap-sm);
}
.tc-comment-body {
    flex: 1;
    min-width: 0;
}
.tc-comment-user {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tc-text-secondary);
}
.tc-comment-input {
    display: flex;
    flex-direction: column;
    gap: var(--tc-gap-sm);
    align-items: flex-end;
}

/* ── Timeline dot (TaskForm activity) ── */
.tc-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tc-accent-light);
    flex-shrink: 0;
    margin-top: 5px;
}
.tc-timeline-text {
    font-size: 0.82rem;
    color: var(--tc-text-secondary);
    line-height: 1.4;
}

/* ── Progress Bar ── */
.tc-progress {
    width: 100%;
    height: 8px;
    background: var(--tc-bg-subtle);
    border-radius: 100px;
    overflow: hidden;
}
.tc-progress-mini {
    height: 6px;
    max-width: 80px;
}
.tc-progress-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.35s ease;
    min-width: 0;
}

/* ── Progress column in task rows ── */
.tc-task-progress-col {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
    flex-shrink: 0;
}
.tc-task-pct {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--tc-text-muted);
    min-width: 28px;
    text-align: right;
}

/* ── Concerned persons grid (TaskForm) ── */
.tc-concerned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px 12px;
}
.tc-concerned-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--tc-radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--tc-text-secondary);
    transition: background 0.15s;
}
.tc-concerned-item:hover {
    background: var(--tc-bg-subtle);
}
.tc-concerned-item input[type="checkbox"] {
    accent-color: var(--tc-accent);
}
