:root {
    /* Light Mode Variables */
    --bg-app: #f9f9fc;
    --bg-surface: #ffffff;
    --bg-column: #f1f2f6;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    
    --text-main: #111827;
    --text-muted: #6b7280;
    
    --primary: #4F46E5; /* Vibrant Indigo / Igreja */
    --primary-hover: #4338ca;
    
    --border: #e5e7eb;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    
    --font: 'Inter', sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.125);
    
    --tag-blue: #dbeafe; --tag-blue-text: #1e40af;
    --tag-red: #fee2e2; --tag-red-text: #b91c1c;
    --tag-yellow: #fef3c7; --tag-yellow-text: #b45309;
    --tag-green: #d1fae5; --tag-green-text: #065f46;
}

[data-theme='dark'] {
    /* Dark Mode Variables - Premium Dark Theme */
    --bg-app: #0f172a; /* Slate 900 */
    --bg-surface: #1e293b; /* Slate 800 */
    --bg-column: #0b1120; /* Slate 950 */
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #6366f1;
    --primary-hover: #818cf8;
    
    --border: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-card: 0 2px 4px rgba(0,0,0,0.4);
    
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);

    --tag-blue: #1e3a8a; --tag-blue-text: #bfdbfe;
    --tag-red: #7f1d1d; --tag-red-text: #fecaca;
    --tag-yellow: #78350f; --tag-yellow-text: #fde68a;
    --tag-green: #064e3b; --tag-green-text: #a7f3d0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow: hidden; /* Stop whole page scrolling, handled within regions */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ======== SIDEBAR ======== */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar-header {
    height: 70px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

.logo-text {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
}

.menu-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 24px;
    margin-bottom: 12px;
    display: block;
}

.sidebar-menu ul {
    list-style: none;
}

.workspace-switcher-box {
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.workspace-switcher-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.workspace-switcher-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: var(--font);
}

.workspace-switcher-empty {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.sidebar-menu li {
    padding: 10px 24px;
    margin: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-menu li a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    font-size: inherit;
}

.sidebar-menu li:hover {
    background-color: var(--bg-app);
    color: var(--primary);
}

.sidebar-menu li:hover a {
    color: var(--primary);
}

.sidebar-menu li.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.user-profile {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-profile:hover {
    background: var(--bg-app);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--bg-surface); }

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name { font-weight: 600; font-size: 14px; }
.user-info .role { font-size: 12px; color: var(--text-muted); }

/* ======== MAIN CONTENT ======== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TOPBAR */
.topbar {
    height: 70px;
    backdrop-filter: blur(10px);
    background-color: var(--glass-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    z-index: 5;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--bg-app);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    width: 300px;
    transition: all 0.3s;
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-container i { color: var(--text-muted); margin-right: 8px; }
.search-container input {
    border: none; background: transparent; outline: none; width: 100%;
    color: var(--text-main); font-family: var(--font);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: transparent; border: none; cursor: pointer;
    font-size: 18px; color: var(--text-muted);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative; transition: 0.2s;
}

.icon-btn:hover { background: var(--bg-app); color: var(--text-main); }
.badge {
    position: absolute; top: 4px; right: 4px;
    background: #ef4444; color: white;
    font-size: 10px; font-weight: bold;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.notifications-panel {
    position: fixed;
    top: 82px;
    right: 24px;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 16px;
    z-index: 140;
    display: none;
}

.notifications-panel.active {
    display: block;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-app);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-item strong {
    font-size: 14px;
}

.notification-item span,
.notifications-empty {
    color: var(--text-muted);
    font-size: 13px;
}

.notification-overdue {
    border-color: rgba(239, 68, 68, 0.35);
}

.notification-today {
    border-color: rgba(245, 158, 11, 0.35);
}

.notification-comments {
    border-color: rgba(79, 70, 229, 0.35);
}

.new-btn {
    background: var(--primary); color: white;
    border: none; padding: 10px 20px; border-radius: 8px;
    font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: 0.2s; box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}
.new-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }

.mobile-menu-toggle,
.mobile-sidebar-close,
.mobile-sidebar-backdrop {
    display: none;
}

/* BOARD HEADER */
.board-header {
    padding: 32px 32px 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.board-title h1 {
    font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
    display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.board-title p { color: var(--text-muted); font-size: 14px; }

.tag-status {
    background: rgba(16, 185, 129, 0.1); color: #10b981;
    font-size: 12px; padding: 4px 10px; border-radius: 12px; font-weight: 600; text-transform: uppercase;
}

.avatar-group { display: flex; align-items: center; }
.avatar-group img { margin-right: -10px; z-index: 1; }
.add-member {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2px dashed var(--text-muted); background: transparent;
    color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 2; margin-left: 8px; transition: 0.2s;
}
.add-member:hover { border-color: var(--primary); color: var(--primary); }


/* BOARD CANVAS (KANBAN) */
.board-canvas {
    flex: 1;
    padding: 0 32px 32px 32px;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: flex-start;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Coluna (Lista) */
.column {
    background-color: var(--bg-column);
    border-radius: 12px;
    width: 320px;
    min-width: 320px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.column-header {
    padding: 16px;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; color: var(--text-main); font-size: 15px;
}
.column-header span.count { color: var(--text-muted); font-weight: 500; margin-left: 8px; }
.column-header button { border: none; background: none; color: var(--text-muted); cursor: pointer; }

/* The Droppable Area */
.column-body {
    padding: 0 16px 16px 16px;
    overflow-y: auto;
    flex: 1;
    min-height: 50px; /* target area for drop */
    transition: background 0.2s;
}

.column-body.drag-over {
    background-color: rgba(79, 70, 229, 0.05); /* Highlight list on hover */
    border-radius: 8px;
}

.column-body.touch-drop-target {
    outline: 2px dashed var(--primary);
    outline-offset: -6px;
}

.add-card-btn {
    margin: 0 16px 16px 16px; padding: 10px;
    background: transparent; border: none;
    color: var(--text-muted); font-weight: 500; cursor: pointer;
    text-align: left; border-radius: 8px; transition: 0.2s; display: flex; align-items: center; gap: 8px;
}
.add-card-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }
[data-theme='dark'] .add-card-btn:hover { background: rgba(255,255,255,0.05); }

/* Card Components */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card:active { cursor: grabbing; transform: scale(0.98); }
.card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }

.card.dragging { opacity: 0.5; border: 2px dashed var(--primary); }
.card.touch-drag-source { opacity: 0.35; }

.mobile-drag-ghost {
    position: fixed;
    z-index: 300;
    pointer-events: none;
    transform: rotate(2deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.28);
    opacity: 0.95;
}

.card-labels { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.label { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.label.blue { background: var(--tag-blue); color: var(--tag-blue-text); }
.label.purple { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.label.red { background: var(--tag-red); color: var(--tag-red-text); }
.label.green { background: var(--tag-green); color: var(--tag-green-text); }
.label.yellow { background: var(--tag-yellow); color: var(--tag-yellow-text); }
.label.orange { background: rgba(249, 115, 22, 0.16); color: #c2410c; }
.label.pink { background: rgba(236, 72, 153, 0.16); color: #be185d; }
.label.cyan { background: rgba(6, 182, 212, 0.16); color: #0e7490; }
.label.teal { background: rgba(20, 184, 166, 0.16); color: #0f766e; }
.label.gray { background: rgba(100, 116, 139, 0.16); color: #475569; }
.label.lime { background: rgba(132, 204, 22, 0.18); color: #4d7c0f; }

.card-title { font-size: 14px; font-weight: 500; margin-bottom: 12px; line-height: 1.4; }

.card-thumbnail {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.card-footer { display: flex; justify-content: space-between; align-items: center; }
.card-badges { display: flex; gap: 12px; color: var(--text-muted); font-size: 12px; }
.card-badges span { display: flex; align-items: center; gap: 4px; }
.card-badges i { font-size: 14px; }

/* ======== MODAL ======== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; opacity: 0; pointer-events: none; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 32px; border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    position: relative;
    max-height: 90vh; overflow-y: auto;
}

.card-modal-content {
    background: var(--bg-surface);
    width: 1080px; max-width: 95vw; max-height: 92vh;
    border-radius: 16px; box-shadow: var(--shadow-md);
    position: relative; overflow-y: auto; padding: 32px;
    transform: translateY(20px); transition: 0.3s;
    border: 1px solid var(--border);
}
.modal-overlay.active .card-modal-content { transform: translateY(0); }

.close-modal {
    position: absolute; top: 24px; right: 24px;
    background: transparent; border: none; font-size: 20px;
    color: var(--text-muted); cursor: pointer;
    z-index: 10;
}
.close-modal:hover { color: var(--text-main); }

.modal-header { margin-bottom: 20px; position: relative; }
.modal-label { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.modal-header h2 { font-size: 26px; color: var(--text-main); font-weight: 800; letter-spacing: -0.5px; border: none; background: transparent; width: 100%; outline: none; padding: 4px 0; }

.modal-body-layout { display: flex; gap: 40px; }
.modal-main { flex: 1.8; min-width: 0; }
.modal-sidebar { flex: 1.2; min-width: 0; background: var(--bg-app); border-radius: 12px; border: 1px solid var(--border); display: flex; flex-direction: column; max-height: 75vh; position: relative; overflow: hidden; }

/* ClickUp Brain Assistant Banner */
.brain-banner {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(79, 70, 229, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.brain-banner i { color: #8b5cf6; font-size: 16px; animation: brain-glow 2s infinite alternate; }
.brain-banner span { font-size: 12px; color: var(--text-main); font-weight: 500; }
.brain-banner button { background: var(--primary); border: none; padding: 4px 10px; border-radius: 6px; color: white; font-size: 10px; font-weight: 600; cursor: pointer; transition: 0.2s; margin-left: auto; }
.brain-banner button:hover { background: var(--primary-hover); }

@keyframes brain-glow {
    0% { transform: scale(1); filter: drop-shadow(0 0 1px rgba(139, 92, 246, 0.5)); }
    100% { transform: scale(1.1); filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.8)); }
}

/* Metadata Grid */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 32px;
    margin-bottom: 28px;
    background: var(--bg-app);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.metadata-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}
.metadata-label {
    width: 110px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.metadata-label i { width: 14px; text-align: center; }
.metadata-value {
    flex: 1;
    color: var(--text-main);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modern Status & Priority Badges */
.status-pill-select {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
}
.status-pill-select option {
    background: var(--bg-surface);
    color: var(--text-main);
}
.priority-pill-select {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Quick Actions Link Bar */
.quick-action-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.quick-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: 0.2s;
    border: 1px dashed var(--border);
}
.quick-action-btn:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
    border-color: var(--primary);
}

/* Sidebar activity timeline ClickUp Style */
.sidebar-activity-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}
.sidebar-activity-header i { color: var(--text-muted); }
.activity-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.activity-log-item {
    font-size: 11px;
    color: var(--text-muted);
    padding: 6px 10px;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    line-height: 1.4;
}
.activity-log-item strong { color: var(--text-main); }

.comment-bubble {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    position: relative;
}
.comment-bubble-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.comment-bubble-author {
    font-weight: 700;
    color: var(--text-main);
}
.comment-bubble-text {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.4;
}

/* Fixed comment box at the bottom of the sidebar */
.sidebar-comment-box {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    border-radius: 0 0 12px 12px;
}
.sidebar-comment-box-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
}
.sidebar-comment-box-inner input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
}
.sidebar-comment-box-inner button {
    background: var(--primary);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.sidebar-comment-box-inner button:hover { background: var(--primary-hover); transform: scale(1.05); }

/* Master Header Compact Action Buttons */
.modal-actions-header {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    background: var(--bg-app);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    align-items: center;
}
.modal-actions-header .btn-header-action {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.modal-actions-header .btn-header-action:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border-color: var(--primary);
}
.modal-actions-header .btn-header-action.danger:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

.modal-section { margin-bottom: 32px; }
.modal-section h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--text-main); }
.modal-section h3 i { color: var(--text-muted); }

.desc-editor {
    width: 100%; min-height: 100px;
    background: var(--bg-app); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px; color: var(--text-main); font-family: var(--font); resize: vertical;
}

.modal-text-input {
    width: 100%;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main);
    font-family: var(--font);
}

.modal-text-input[list]::-webkit-calendar-picker-indicator {
    display: none !important;
}

.inline-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.compact-btn {
    width: auto;
    margin-bottom: 0;
    white-space: nowrap;
}

.compact-select {
    max-width: 140px;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.preset-labels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.preset-label-chip {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.preset-label-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.preset-label-chip.blue { background: var(--tag-blue); color: var(--tag-blue-text); }
.preset-label-chip.purple { background: rgba(99, 102, 241, 0.14); color: var(--primary); }
.preset-label-chip.green { background: var(--tag-green); color: var(--tag-green-text); }
.preset-label-chip.yellow { background: var(--tag-yellow); color: var(--tag-yellow-text); }
.preset-label-chip.red { background: var(--tag-red); color: var(--tag-red-text); }
.preset-label-chip.orange { background: rgba(249, 115, 22, 0.16); color: #c2410c; }
.preset-label-chip.pink { background: rgba(236, 72, 153, 0.16); color: #be185d; }
.preset-label-chip.cyan { background: rgba(6, 182, 212, 0.16); color: #0e7490; }
.preset-label-chip.teal { background: rgba(20, 184, 166, 0.16); color: #0f766e; }
.preset-label-chip.gray { background: rgba(100, 116, 139, 0.16); color: #475569; }
.preset-label-chip.lime { background: rgba(132, 204, 22, 0.18); color: #4d7c0f; }

.workspace-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workspace-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
}

.editor-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-app);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
}

.editor-pill button,
.checklist-delete,
.comment-delete {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.editor-pill button:hover,
.checklist-delete:hover,
.comment-delete:hover {
    color: #ef4444;
}

.progress-bar-container { width: 100%; height: 6px; background: var(--bg-app); border-radius: 3px; margin-bottom: 12px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); transition: 0.3s; }

.checklist-items { list-style: none; }
.checklist-items li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; background: var(--bg-app); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.checklist-items li span { flex: 1; }
.checklist-items li.dragging { opacity: 0.5; }

.checklist-edit-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
}

.checklist-handle {
    color: var(--text-muted);
    cursor: grab;
}

.comment-box { display: flex; gap: 12px; }
.comment-box input {
    flex: 1; background: var(--bg-app); border: 1px solid var(--border);
    border-radius: 20px; padding: 10px 16px; color: var(--text-main); font-family: var(--font);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-item {
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-app);
}

.file-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.file-link:hover {
    color: var(--primary);
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.image-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-app);
    min-height: 120px;
}

.image-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: rgba(15, 23, 42, 0.8);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
}

.sidebar-title { font-size: 12px; text-transform: uppercase; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; display: block; }
.sidebar-btn {
    width: 100%; text-align: left; padding: 8px 12px; background: var(--bg-app);
    border: none; border-radius: 6px; margin-bottom: 8px; color: var(--text-main);
    font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px;
    transition: 0.2s;
}

.column-menu-btn.active {
    color: var(--primary);
}
.sidebar-btn:hover { background: rgba(79,70,229,0.1); color: var(--primary); }
.sidebar-btn.danger:hover { background: #fee2e2; color: #b91c1c; }
[data-theme='dark'] .sidebar-btn.danger:hover { background: rgba(220,38,38,0.2); }

.spacer { height: 24px; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-app); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .topbar,
    .board-header {
        padding-left: 20px;
        padding-right: 20px;
    }

    .board-canvas {
        padding-left: 20px;
        padding-right: 20px;
        gap: 16px;
    }

    .column {
        width: 280px;
        min-width: 280px;
    }

    .card-modal-content {
        width: min(92vw, 900px);
        padding: 24px;
    }

    .modal-body-layout {
        gap: 20px;
    }

    .modal-sidebar {
        width: 160px;
    }

    .calendar-container {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .app-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100%;
    }

    .sidebar {
        width: min(86vw, 320px);
        max-width: 320px;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        border-right: 1px solid var(--border);
        border-bottom: none;
        box-shadow: 0 20px 50px rgba(0,0,0,0.25);
        z-index: 120;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-header {
        height: auto;
        padding: 16px 20px;
        justify-content: space-between;
    }

    .sidebar-menu {
        padding: 12px 0;
        overflow: visible;
    }

    .menu-section {
        margin-bottom: 16px;
    }

    .main-content {
        overflow: visible;
        min-width: 0;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        position: fixed;
        top: 14px;
        left: 14px;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--bg-surface);
        color: var(--text-main);
        align-items: center;
        justify-content: center;
        font-size: 18px;
        z-index: 130;
        box-shadow: var(--shadow-md);
    }

    .mobile-sidebar-close {
        display: inline-flex;
        width: 38px;
        height: 38px;
        border-radius: 10px;
        border: 1px solid var(--border);
        background: var(--bg-app);
        color: var(--text-main);
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .mobile-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 110;
    }

    .notifications-panel {
        right: 12px;
        left: 12px;
        top: 68px;
        width: auto;
        max-width: none;
    }

    body.sidebar-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar {
        height: auto;
        padding: 16px 20px 16px 68px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-container {
        width: 100%;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }

    .new-btn {
        width: 100%;
        justify-content: center;
    }

    .icon-btn,
    .new-btn,
    .sidebar-btn,
    .btn-save,
    .add-card-btn {
        min-height: 44px;
    }

    .board-header {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .board-title h1 {
        font-size: 22px;
        flex-wrap: wrap;
    }

    .board-canvas {
        padding: 0 20px 20px 20px;
        scroll-snap-type: x proximity;
    }

    .column {
        width: 85vw;
        min-width: 85vw;
        max-width: 85vw;
        scroll-snap-align: start;
    }

    .avatar-group,
    .add-member,
    .badge {
        display: none !important;
    }

    #fab-global-create {
        width: 56px !important;
        height: 56px !important;
        right: 18px !important;
        bottom: 18px !important;
        font-size: 20px !important;
    }

    .card-modal-content,
    .modal-box {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        padding: 20px;
        border-radius: 14px;
    }

    .close-modal {
        top: 16px;
        right: 16px;
    }

    .modal-header h2 {
        font-size: 20px;
        padding-right: 32px;
    }

    .modal-body-layout {
        flex-direction: column;
        gap: 20px;
    }

    .modal-sidebar {
        width: 100%;
    }

    .inline-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .compact-btn,
    .compact-select {
        width: 100%;
        max-width: none;
    }

    .workspace-selector {
        gap: 10px;
    }

    .image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card {
        box-shadow: none;
        border-radius: 12px;
    }

    .card-labels {
        gap: 4px;
        margin-bottom: 6px;
    }

    .label {
        font-size: 10px;
        padding: 3px 6px;
    }

    .card-footer {
        gap: 10px;
    }

    .card-badges {
        gap: 8px;
        font-size: 11px;
        flex-wrap: wrap;
    }

    .calendar-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 20px 20px 20px;
        margin-top: 0;
    }

    .calendar-header {
        display: none;
    }

    .calendar-day {
        min-height: 110px;
    }

    .calendar-toolbar,
    .board-filters {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    .calendar-month-input,
    #ws-switcher {
        width: 100%;
    }

    .user-profile {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .sidebar-menu li {
        margin-left: 8px;
        margin-right: 8px;
        padding-left: 14px;
        padding-right: 14px;
        font-size: 14px;
    }

    .topbar,
    .board-header,
    .board-canvas,
    .calendar-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .topbar {
        padding-left: 60px;
    }

    .mobile-menu-toggle {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .notifications-panel {
        left: 8px;
        right: 8px;
        top: 60px;
        padding: 12px;
        border-radius: 14px;
    }

    .column {
        width: calc(100vw - 28px);
        min-width: calc(100vw - 28px);
        max-width: calc(100vw - 28px);
    }

    .card {
        padding: 12px;
    }

    .card-thumbnail {
        height: 120px;
    }

    .board-title h1 {
        font-size: 20px;
    }

    .board-title p,
    .modal-label,
    .sidebar-title,
    .section-title {
        font-size: 12px;
    }

    #fab-global-create {
        width: 50px !important;
        height: 50px !important;
        right: 12px !important;
        bottom: 12px !important;
        font-size: 18px !important;
    }

    .modal-section {
        margin-bottom: 24px;
    }

    .checklist-items li,
    .file-item,
    .comment-item,
    .workspace-option {
        padding: 10px;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .calendar-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .calendar-day.empty {
        display: none;
    }
}
