/* ============================================================
   App CSS — Todo App (ClickUp Clone)
   Light mode only. Custom styles beyond Tailwind.
   ============================================================ */

/* Base font */
body { font-family: 'Inter', sans-serif; }
:root { --list-row-padding-y: 12px; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Glass panel */
.glass-panel { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(12px); }

/* Sidebar tree item transitions (dark theme) */
.sidebar-item {
    transition: background-color 0.1s ease;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
}
.sidebar-item:hover { background-color: #1e293b; }
.sidebar-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    font-weight: 500;
}
.sidebar-item.sidebar-item-keyboard-active {
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.55);
    background-color: rgba(59, 130, 246, 0.12);
}
.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: #3b82f6;
    border-radius: 0 3px 3px 0;
}
.sidebar-item .node-add-btn { opacity: 0; transition: opacity 0.1s ease; }
.sidebar-item:hover .node-add-btn { opacity: 1; }

/* Task row */
.task-row {
    transition: background-color 0.1s ease;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}
#view-area[data-view="list"] .task-row {
    padding-top: var(--list-row-padding-y, 12px);
    padding-bottom: var(--list-row-padding-y, 12px);
}
.task-row:hover { background-color: #f8fafc; }
.task-row[draggable="true"] { cursor: grab; }
.task-row.task-row-keyboard-active {
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.28);
}
.task-row-focus-root {
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
}
.task-row-focus-root:hover {
    background: linear-gradient(180deg, #f3f8ff 0%, #e8f0fb 100%);
}
.task-row-dragging {
    opacity: 0.55;
    cursor: grabbing;
}
.task-inline-title-input {
    min-width: 0;
}
.task-focus-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 9999px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.task-focus-inline-btn:hover {
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.18);
    background: rgba(239, 246, 255, 0.95);
}
.task-focus-inline-btn-active {
    color: #2563eb;
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(239, 246, 255, 0.95);
}
.task-drag-handle { cursor: grab; }
.task-row-dragging .task-drag-handle { cursor: grabbing; }
.task-drop-before::before,
.task-drop-after::after,
.board-drop-before::before,
.board-drop-after::after {
    content: '';
    position: absolute;
    left: calc(1rem + var(--task-drop-offset, 0px));
    right: 1rem;
    height: 2px;
    background: #3b82f6;
    border-radius: 9999px;
    box-shadow: 0 0 0 2px rgba(219, 234, 254, 0.9);
}
.task-drop-before::before,
.board-drop-before::before { top: -1px; }
.task-drop-after::after,
.board-drop-after::after { bottom: -1px; }
.task-drop-child {
    background: rgba(239, 246, 255, 0.72);
}
.task-drop-into {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.92) 0%, rgba(219, 234, 254, 0.88) 100%);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.32);
}
.task-drop-into::after {
    content: 'Drop into';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: rgba(255, 255, 255, 0.92);
    color: #2563eb;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    pointer-events: none;
}
.task-dropzone {
    position: relative;
    transition: background-color 0.15s ease;
}
.task-dropzone-active {
    background: rgba(59, 130, 246, 0.04);
}
.task-dropzone-empty {
    min-height: 60px;
    margin: 0.75rem 1rem 0.25rem;
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
}
.task-dropzone-empty-state {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #94a3b8;
}
.task-dropzone-empty-active {
    background: #eff6ff;
    border-color: #60a5fa;
}
.task-dropzone-empty-active .task-dropzone-empty-state {
    color: #2563eb;
}
body.task-dragging-active .task-row,
body.task-dragging-active .task-drag-handle {
    user-select: none;
}

#sidebar-tree,
#view-area {
    outline: none;
}
#sidebar-tree.keyboard-region-active,
#view-area.keyboard-region-active {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.12);
}

/* Status group header */
.status-group-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 8px 0;
}

.task-focus-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.task-focus-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.task-focus-back-btn,
.task-focus-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 8px 12px;
    transition: all 0.15s ease;
}
.task-focus-back-btn:hover,
.task-focus-action-btn:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #f8fbff;
}
.task-focus-meta {
    flex: 1 1 280px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}
.task-focus-path {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
}
.task-focus-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
}
.task-focus-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}
.task-focus-action-btn-primary {
    border-color: transparent;
    background: #2563eb;
    color: #ffffff;
}
.task-focus-action-btn-primary:hover {
    border-color: transparent;
    background: #1d4ed8;
    color: #ffffff;
}
.task-focus-rows {
    min-width: fit-content;
}
.task-focus-empty {
    padding: 4px 4px 0;
    font-size: 0.8125rem;
    color: #64748b;
}

/* Status dot with glow */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}
.status-dot-todo { background: #94a3b8; box-shadow: 0 0 0 2px rgba(148,163,184,0.2); }
.status-dot-progress { background: #8b5cf6; box-shadow: 0 0 0 2px rgba(139,92,246,0.2); }
.status-dot-done { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,0.2); }

/* Board card */
.board-card {
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    cursor: pointer;
    position: relative;
}
.board-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.board-card[draggable="true"] {
    cursor: grab;
}
.board-card-dragging {
    opacity: 0.55;
    cursor: grabbing;
}
.board-card.board-card-keyboard-active {
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}
.board-dropzone {
    position: relative;
    transition: background-color 0.15s ease;
    min-height: 80px;
}
.board-dropzone-active {
    background: rgba(59, 130, 246, 0.04);
}
.board-dropzone-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 0.5rem;
}
.board-dropzone-empty-state {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #94a3b8;
    pointer-events: none;
}
.board-dropzone-empty-active {
    background: #eff6ff;
    border-color: #60a5fa;
}
.board-dropzone-empty-active .board-dropzone-empty-state {
    color: #2563eb;
}

/* Priority colors */
.priority-urgent { color: #ef4444; }
.priority-high { color: #f97316; }
.priority-medium { color: #eab308; }
.priority-low { color: #6b7280; }

/* Task detail panel slide-in */
#task-detail-panel {
    transition: width 0.2s ease, opacity 0.2s ease;
}

/* Dropdown menu */
.dropdown-menu {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 50;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Button base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
}
.btn-primary {
    background-color: #3b82f6;
    color: white;
}
.btn-primary:hover { background-color: #2563eb; }
.btn-secondary {
    background-color: #f1f5f9;
    color: #374151;
}
.btn-secondary:hover { background-color: #e2e8f0; }
.btn-danger {
    background-color: #fef2f2;
    color: #dc2626;
}
.btn-danger:hover { background-color: #fee2e2; }
.btn-ghost {
    background: transparent;
    color: #6b7280;
}
.btn-ghost:hover { background-color: #f1f5f9; color: #374151; }

/* Form inputs */
.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #9ca3af;
    text-align: center;
}

/* Kanban column */
.kanban-column {
    min-width: 280px;
    max-width: 320px;
    background: #f8fafc;
    border-radius: 8px;
}

/* Sidebar global search */
#global-search-box {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
#global-search-box:focus-visible {
    outline: none;
    border-color: rgba(96, 165, 250, 0.85);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

/* ============================================================
   Global Search Modal
   ============================================================ */
.global-search-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 125;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 9vh 1.5rem 1.5rem;
    background:
        radial-gradient(circle at top, rgba(96, 165, 250, 0.16), transparent 34%),
        rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(10px);
}
.global-search-modal-panel {
    width: min(760px, 100%);
    max-height: min(72vh, 720px);
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 0.98) 18%, #ffffff 100%);
    box-shadow: 0 38px 100px -34px rgba(15, 23, 42, 0.72);
    display: flex;
    flex-direction: column;
}
.global-search-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.4rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.88);
}
.global-search-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}
.global-search-modal-subtitle {
    margin-top: 0.28rem;
    font-size: 0.88rem;
    color: #64748b;
}
.global-search-modal-close {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.global-search-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.global-search-input-wrap {
    margin: 1rem 1.4rem 0;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.8);
    padding: 0 1rem;
}
.global-search-input-wrap:focus-within {
    border-color: rgba(59, 130, 246, 0.52);
    box-shadow:
        inset 0 1px 0 rgba(248, 250, 252, 0.8),
        0 0 0 4px rgba(59, 130, 246, 0.1);
}
.global-search-input-icon {
    color: #94a3b8;
    font-size: 1rem;
}
.global-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    padding: 0.95rem 0;
    font-size: 0.96rem;
    color: #0f172a;
}
.global-search-input::placeholder {
    color: #94a3b8;
}
.global-search-input-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.7rem;
    border: 1px solid #dbe4ef;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
}
.global-search-results {
    padding: 1rem 1.4rem 1.4rem;
    overflow-y: auto;
    min-height: 260px;
}
.global-search-section {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.global-search-section + .global-search-section {
    margin-top: 0.95rem;
}
.global-search-section-title {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.92);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}
.global-search-result {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    text-align: left;
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-top: 1px solid rgba(226, 232, 240, 0.78);
    cursor: pointer;
    transition: background-color 0.12s ease;
}
.global-search-result:first-of-type {
    border-top: 0;
}
.global-search-result:hover,
.global-search-result.is-active {
    background: #eff6ff;
}
.global-search-result-icon {
    width: 2.3rem;
    height: 2.3rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(96, 165, 250, 0.2));
    color: #2563eb;
    font-size: 1rem;
}
.global-search-result-copy {
    min-width: 0;
    flex: 1;
}
.global-search-result-title {
    font-size: 0.94rem;
    font-weight: 600;
    color: #0f172a;
}
.global-search-result-context {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.global-search-result-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.7rem;
    font-weight: 700;
}
.global-search-empty-state {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.global-search-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.global-search-empty-copy {
    margin-top: 0.45rem;
    max-width: 28rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #64748b;
}
.global-search-empty-row,
.global-search-error,
.global-search-loading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.95rem 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.78);
    font-size: 0.82rem;
    color: #64748b;
}
.global-search-error {
    color: #b91c1c;
}

/* ============================================================
   Shortcut Modal
   ============================================================ */
.shortcut-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(15, 23, 42, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(4px);
}
.shortcut-modal-panel {
    width: min(760px, 100%);
    max-height: 85vh;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 24px 80px -24px rgba(15, 23, 42, 0.45);
    display: flex;
    flex-direction: column;
}
.shortcut-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}
.shortcut-group {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.shortcut-group-title {
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(248, 250, 252, 0.9);
}
.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}
.shortcut-row:first-of-type {
    border-top: 0;
}
.shortcut-row-copy {
    min-width: 0;
}
.shortcut-row-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}
.shortcut-row-desc {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #64748b;
}
.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.shortcut-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.65rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
}

/* ============================================================
   Task Create Modal
   ============================================================ */
.task-create-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.14), transparent 34%),
        rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(8px);
}
.task-create-modal-panel {
    width: min(560px, 100%);
    animation: task-create-modal-in 0.16s ease;
}
.task-create-modal-shell {
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(255, 255, 255, 0.98) 28%),
        #ffffff;
    box-shadow: 0 32px 90px -28px rgba(15, 23, 42, 0.55);
}
.task-create-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.35rem 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 55%),
        #ffffff;
}
.task-create-modal-header-copy {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-width: 0;
}
.task-create-modal-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    color: #ffffff;
    box-shadow: 0 14px 30px -18px rgba(37, 99, 235, 0.85);
    font-size: 1.15rem;
}
.task-create-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}
.task-create-modal-subtitle {
    margin-top: 0.3rem;
    font-size: 0.875rem;
    color: #64748b;
}
.task-create-modal-close {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.9rem;
    color: #64748b;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.task-create-modal-close:hover {
    background: rgba(148, 163, 184, 0.14);
    color: #0f172a;
}
.task-create-modal-body {
    padding: 1.25rem 1.35rem 1.35rem;
}
.task-create-modal-context {
    margin-bottom: 1rem;
}
.task-create-modal-context-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 9999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.task-create-modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.task-create-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.task-create-modal-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}
.task-create-modal-input,
.task-create-modal-select {
    border-radius: 0.9rem;
    padding: 0.85rem 0.95rem;
    border-color: #cbd5e1;
    background: rgba(255, 255, 255, 0.96);
}
.task-create-modal-input::placeholder {
    color: #94a3b8;
}
.task-create-modal-error {
    border: 1px solid #fecaca;
    border-radius: 0.95rem;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.875rem;
    padding: 0.8rem 0.95rem;
}
.task-create-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.25rem;
}
.task-create-modal-hint {
    font-size: 0.8rem;
    color: #94a3b8;
}
@keyframes task-create-modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@media (max-width: 640px) {
    .global-search-modal-overlay {
        padding: 1rem;
        align-items: stretch;
    }
    .global-search-modal-panel {
        width: 100%;
        max-height: none;
        min-height: 100%;
        border-radius: 24px;
    }
    .global-search-results {
        min-height: 0;
    }
    .task-create-modal-overlay {
        align-items: flex-end;
        padding: 1rem;
    }
    .task-create-modal-shell {
        border-radius: 22px 22px 18px 18px;
    }
    .task-create-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .task-create-modal-footer .btn {
        width: 100%;
    }
}

/* ============================================================
   Column Manager Modal
   ============================================================ */
.col-manager-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    backdrop-filter: blur(2px);
}
.col-manager-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.2);
    width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: col-manager-in 0.15s ease;
}
@keyframes col-manager-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.col-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.col-manager-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}
.col-manager-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.1s ease;
}
.col-manager-row:hover {
    background: #f8fafc;
}
.col-manager-name-input {
    flex: 1;
    min-width: 0;
    padding: 2px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #334155;
    background: transparent;
    transition: border-color 0.15s ease;
    outline: none;
}
.col-manager-name-input:hover {
    border-color: #cbd5e1;
}
.col-manager-name-input:focus {
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.col-manager-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.col-manager-toggle-on {
    color: #3b82f6;
    background: #eff6ff;
}
.col-manager-toggle-on:hover {
    background: #dbeafe;
}
.col-manager-toggle-off {
    color: #94a3b8;
    background: #f1f5f9;
}
.col-manager-toggle-off:hover {
    color: #64748b;
    background: #e2e8f0;
}
.col-manager-move {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    color: #94a3b8;
    background: transparent;
    cursor: pointer;
    transition: all 0.1s ease;
    flex-shrink: 0;
}
.col-manager-move:hover {
    color: #475569;
    background: #f1f5f9;
}
.col-manager-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    color: #94a3b8;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.col-manager-delete:hover {
    color: #dc2626;
    background: #fef2f2;
}
.col-manager-add-form {
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
    margin-top: 8px;
}

/* ============================================================
   List View — Dynamic Column Headers & Scroll
   ============================================================ */
.list-scroll-wrap {
    overflow-x: auto;
    border-radius: 12px;
}
.list-col-header {
    display: grid;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    min-width: fit-content;
}
.list-add-col-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}
.list-add-col-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

/* Inline cell editor */
.list-cell-editor input,
.list-cell-editor select {
    width: 100%;
    max-width: 110px;
    font-size: 0.75rem;
    padding: 2px 4px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.list-cell-value {
    transition: background 0.1s ease;
}

/* ============================================================
   Column Header Drag & Drop
   ============================================================ */
.col-header-cell {
    cursor: grab;
    user-select: none;
    position: relative;
    transition: opacity 0.15s ease;
}
.col-header-cell.col-dragging {
    opacity: 0.4;
    cursor: grabbing;
}
.col-header-cell.col-drop-left::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 2px;
    bottom: 2px;
    width: 2px;
    background: #3b82f6;
    border-radius: 1px;
}
.col-header-cell.col-drop-right::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 2px;
    bottom: 2px;
    width: 2px;
    background: #3b82f6;
    border-radius: 1px;
}

/* Table header drag */
th.col-header-cell { cursor: grab; user-select: none; position: relative; }
th.col-header-cell.col-dragging { opacity: 0.4; }
th.col-header-cell.col-drop-left { box-shadow: inset 3px 0 0 0 #3b82f6; }
th.col-header-cell.col-drop-right { box-shadow: inset -3px 0 0 0 #3b82f6; }

/* ============================================================
   Column Context Menu
   ============================================================ */
.col-context-menu {
    position: fixed;
    z-index: 200;
    min-width: 170px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
    padding: 4px;
    animation: ctx-in 0.1s ease;
}
@keyframes ctx-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}
.col-context-menu button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: #475569;
    border-radius: 5px;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.1s ease;
}
.col-context-menu button:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.col-context-menu button.ctx-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}
.col-context-menu .ctx-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* ============================================================
   Sidebar Node Drag & Drop
   ============================================================ */
.sidebar-item[draggable="true"] { cursor: grab; }
.sidebar-item.node-drag-dragging { opacity: 0.35; cursor: grabbing; }
.sidebar-item.node-drop-above::before,
.sidebar-item.node-drop-below::after {
    content: '';
    position: absolute;
    left: 6px;
    right: 6px;
    height: 2px;
    background: #6366f1;
    border-radius: 9999px;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    z-index: 10;
}
.sidebar-item.node-drop-above::before { top: -1px; }
.sidebar-item.node-drop-below::after  { bottom: -1px; }
.sidebar-item.node-drop-into {
    background-color: rgba(99, 102, 241, 0.12) !important;
    outline: 1px dashed rgba(99, 102, 241, 0.4);
    outline-offset: -2px;
}

/* ============================================================
   Planned Date — Quick-Schedule Buttons
   ============================================================ */

/* Pill buttons container (task-detail) */
.planned-date-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Inline variant (list row hover popup — body-appended, vertical menu) */
.planned-date-buttons-inline {
    z-index: 30;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px -6px rgba(0,0,0,0.12);
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    white-space: nowrap;
}

/* Individual pill button */
.planned-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
}
.planned-pill:hover {
    border-color: #93c5fd;
    color: #2563eb;
    background: #eff6ff;
}
.planned-pill-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}
.planned-pill-active:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #ffffff;
}
.planned-pill-clear {
    border-color: #fecaca;
    color: #ef4444;
    padding: 3px 7px;
}
.planned-pill-clear:hover {
    border-color: #ef4444;
    background: #fef2f2;
    color: #dc2626;
}

/* Row trigger — icon + popup container */
.planned-row-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 4px;
}

/* Calendar icon button in row */
.planned-row-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.12s ease;
    opacity: 0;
    font-size: 0.7rem;
}
.task-row:hover .planned-row-icon,
.planned-row-icon-active {
    opacity: 1;
}
.planned-row-icon:hover {
    color: #2563eb;
    background: #eff6ff;
}
.planned-row-icon-active {
    color: #2563eb;
    background: rgba(239, 246, 255, 0.8);
}

/* Label next to icon when date is set */
.planned-row-label {
    font-weight: 600;
    color: inherit;
}

/* Show popup on hover of the trigger — now handled by JS (body-appended popup) */

/* Planned list row — needs position:relative for drop indicator pseudo-elements */
.planned-list-row {
    position: relative;
}
.planned-list-row[draggable="true"] { cursor: grab; }
.planned-list-row.opacity-40 { cursor: grabbing; }

/* Planned dropzone highlight on drag */
.planned-dropzone {
    transition: border-color 0.12s ease, background 0.12s ease;
}
.planned-dropzone.task-dropzone-active {
    border-color: #93c5fd;
    background: rgba(239, 246, 255, 0.5);
}
.planned-dropzone-empty.task-dropzone-active {
    border-style: dashed;
}

/* Planned view — "Add task" row (list mode) */
.planned-add-task-row {
    color: #cbd5e1;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    border-top: 1px solid #f1f5f9;
}
.planned-dropzone:hover .planned-add-task-row,
.planned-add-task-row:focus-within {
    opacity: 1;
}
.planned-add-task-row:hover {
    color: #3b82f6;
    background: #f8fafc;
}

/* Planned view — "Add task" card (board/kanban mode) */
.planned-add-task-card {
    color: #cbd5e1;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    margin-top: 4px;
}
.kanban-column:hover .planned-add-task-card,
.planned-add-task-card:focus-within {
    opacity: 1;
}
.planned-add-task-card:hover {
    color: #3b82f6;
    background: rgba(241, 245, 249, 0.8);
}
