:root {
    --ease-out: all 0.3s ease-out;

    /* Dark Theme (Default) */
    --bg-gradient: #121212;
    --glass-bg: #1e1e1e;
    --glass-border: 1px solid #333;
    --glass-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.2);
    --text-color: #f0f0f0;
    --text-muted: #888888;
    --accent: #667eea; /* Blue-purple from login design */
    --accent-secondary: #764ba2; /* Purple accent */
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-glow: rgba(102, 126, 234, 0.4);
    --project-color: var(--accent);
    --danger: #ff4b4b;
    --warning: #f7b731;
    --success: #20bf6b;
    --input-bg: #2a2a2a;
    --hover-bg: rgba(102, 126, 234, 0.15);
    --active-bg: rgba(118, 75, 162, 0.2);
    --subtle-bg: rgba(0, 0, 0, 0.1);
    --subtle-border: rgba(255,255,255,0.1);
    --scrollbar-thumb: rgba(102, 126, 234, 0.3);
    --scrollbar-thumb-hover: rgba(102, 126, 234, 0.5);
}

body.light-theme {
    --bg-gradient: #f4f7f9;
    --glass-bg: #ffffff;
    --glass-border: 1px solid #e0e7ff;
    --glass-shadow: 0 4px 12px 0 rgba(102, 126, 234, 0.1);
    --text-color: #212529;
    --text-muted: #6c757d;
    --accent: #667eea; /* Blue-purple for light mode */
    --accent-secondary: #764ba2; /* Purple accent */
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-glow: rgba(102, 126, 234, 0.3);
    --danger: #dc3545;
    --warning: #ffc107;
    --success: #28a745;
    --input-bg: #f0f4ff;
    --hover-bg: rgba(102, 126, 234, 0.1);
    --active-bg: rgba(102, 126, 234, 0.15);
    --subtle-bg: rgba(102, 126, 234, 0.03);
    --subtle-border: rgba(102, 126, 234, 0.15);
    --scrollbar-thumb: rgba(102, 126, 234, 0.25);
    --scrollbar-thumb-hover: rgba(102, 126, 234, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

/* Text selection with purple accent */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-color);
}
::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-color);
}

body {
    background: var(--bg-gradient);
    color: var(--text-color);
    height: 100vh;
    transition: background 0.3s, color 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Global Utility */
.hidden { display: none !important; }

/* Swarming Banner */
.swarming-banner {
    position: relative;
    width: 100%;
    min-height: 50px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    font-weight: 500;
    padding: 12px 60px 12px 20px;
    box-shadow: 0 4px 20px rgba(255, 75, 75, 0.3);
    animation: slideDown 0.3s ease-out, bannerGlow 3s ease-in-out infinite;
    border-bottom: 2px solid transparent;
    background-clip: padding-box;
    overflow: hidden;
}
.swarming-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 75, 75, 0.1) 25%,
        rgba(255, 150, 50, 0.1) 50%,
        rgba(255, 75, 75, 0.1) 75%,
        transparent 100%);
    animation: bannerShimmer 3s linear infinite;
    pointer-events: none;
}
.swarming-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        #ff4b4b,
        #ff9f43,
        #ff4b4b,
        #ff9f43,
        #ff4b4b);
    background-size: 200% 100%;
    animation: gradientFlow 2s linear infinite;
}
.swarming-banner span {
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 75, 75, 0.5);
}
.swarming-banner b {
    color: #ff6b6b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Swarming Floating Button - Right Edge */
.swarming-floating-btn {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 55px;
    padding: 25px 12px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border: 2px solid rgba(255, 75, 75, 0.4);
    border-right: none;
    border-radius: 16px 0 0 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 25px rgba(255, 75, 75, 0.4);
    overflow: hidden;
}
.swarming-floating-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(255, 75, 75, 0.1) 50%,
        transparent 100%);
    animation: floatingBtnPulse 2s ease-in-out infinite;
}
.swarming-floating-btn-indicator {
    width: 12px;
    height: 12px;
    background: #ff4b4b;
    border-radius: 50%;
    margin-bottom: 12px;
    animation: indicatorBlink 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px #ff4b4b, 0 0 30px rgba(255, 75, 75, 0.5);
}
.swarming-floating-btn-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ff6b6b;
    text-shadow: 0 0 15px rgba(255, 75, 75, 0.5);
    position: relative;
    z-index: 1;
}
.swarming-floating-btn-expanded {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(20px);
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 75, 75, 0.4);
    border-radius: 12px;
    padding: 20px;
    min-width: 180px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 75, 75, 0.2);
}
.swarming-floating-btn-expanded::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: rgba(255, 75, 75, 0.4);
}
.swarming-floating-btn:hover {
    width: 65px;
    padding: 30px 14px;
    box-shadow: -10px 0 40px rgba(255, 75, 75, 0.6);
}
.swarming-floating-btn:hover .swarming-floating-btn-expanded {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}
.swarming-blocked-count {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff4b4b;
    text-shadow: 0 0 20px rgba(255, 75, 75, 0.5);
    line-height: 1;
    margin-bottom: 5px;
}
.swarming-floating-btn-expanded span {
    font-size: 0.85rem;
    color: #ff9f9f;
    display: block;
    margin-bottom: 15px;
}
.swarming-view-btn {
    background: linear-gradient(90deg, #ff4b4b, #ff6b6b);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.swarming-view-btn:hover {
    background: linear-gradient(90deg, #ff6b6b, #ff8b8b);
    transform: scale(1.05);
}

@keyframes floatingBtnPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
@keyframes indicatorBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes bannerGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(255, 75, 75, 0.3); }
    50% { box-shadow: 0 4px 30px rgba(255, 75, 75, 0.5), 0 0 60px rgba(255, 75, 75, 0.2); }
}
@keyframes bannerShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Glass Utility Classes */
.glass {
    background: var(--glass-bg);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-input, .glass-select {
    background: var(--input-bg);
    border: var(--glass-border);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 6px;
    outline: none;
    height: 35px; /* Fixed height for consistency */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-input:focus, .glass-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Date Input Styling */
input[type="date"] {
    color-scheme: dark; /* Default dark */
}
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
body.light-theme input[type="date"] {
    color-scheme: light;
}
body.light-theme input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
}


.glass-btn {
    background: rgba(255, 255, 255, 0.1);
    border: var(--glass-border);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.glass-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* Primary accent button with gradient */
.glass-btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.glass-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}
.glass-btn.primary { background: var(--accent); border: none; color: #fff; font-weight: 600; }
.glass-btn-sm { padding: 4px 8px; font-size: 0.8rem; border-radius: 4px; background: rgba(255,255,255,0.1); border: var(--glass-border); color: var(--text-color); cursor: pointer; }
body.light-theme .glass-btn-sm { background: rgba(0,0,0,0.05); }

/* Placeholders */
::placeholder { color: rgba(255, 255, 255, 0.5) !important; opacity: 1; }
body.light-theme ::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-gradient);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loading-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
}
.loading-logo .highlight {
    color: var(--accent);
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--subtle-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Layout */
.app-container { display: flex; flex: 1; min-height: 0; }

/* Mobile Menu Toggle - Hidden by default, shown via CSS media query on mobile */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 35px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.mobile-menu-toggle:hover { background: var(--hover-bg); }

/* Sidebar Overlay - Hidden by default */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.sidebar-overlay.active { display: block; }

/* Sidebar */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 20;
    transition: width 0.3s ease;
    overflow-y: auto;
}

.sidebar.collapsed { width: 80px; }
.sidebar.collapsed .logo, 
.sidebar.collapsed .logo-subtitle, 
.sidebar.collapsed .nav-section h3,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-section li,
.sidebar.collapsed .custom-select-wrapper,
.sidebar.collapsed .theme-switcher { display: none !important; } /* Hide text */

.sidebar.collapsed .user-profile { display: flex; justify-content: center; padding: 5px; background: transparent; }
.sidebar.collapsed .user-actions { display: none !important; }
.sidebar.collapsed #btn-open-admin { display: none !important; }
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .logo { display: none; }

.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }

.logo { font-size: 1.5rem; font-weight: 700; }
.logo-subtitle { font-size: 0.7rem; color: var(--text-muted); margin-top: -2px; letter-spacing: 0.5px; }
.highlight { color: var(--accent); }

.nav-section { margin-bottom: 20px; }
.nav-section h3 { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.nav-section ul { list-style: none; }
.nav-section li {
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.8;
    border-left: 3px solid transparent;
}
.nav-section li:hover {
    background: var(--hover-bg);
    opacity: 1;
    border-left-color: var(--accent);
}
.nav-section li.active {
    background: var(--active-bg);
    opacity: 1;
    border-left-color: var(--accent-secondary);
}

#project-list li { color: var(--project-color); display: flex; justify-content: space-between; align-items: center; }

/* Blocked Project in Sidebar */
#project-list li.has-blocked,
#project-list li.has-blocked.active,
#project-list li.has-blocked:hover {
    position: relative;
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%) !important;
    color: #ff6b6b !important;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(255, 75, 75, 0.2);
    opacity: 1;
}
#project-list li.has-blocked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 75, 75, 0.08) 25%,
        rgba(255, 150, 50, 0.08) 50%,
        rgba(255, 75, 75, 0.08) 75%,
        transparent 100%);
    animation: bannerShimmer 4s linear infinite;
    pointer-events: none;
}
#project-list li.has-blocked::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        #ff4b4b,
        #ff9f43,
        #ff4b4b,
        #ff9f43,
        #ff4b4b);
    background-size: 200% 100%;
    animation: gradientFlow 2s linear infinite;
}
#project-list li.has-blocked span {
    position: relative;
    z-index: 1;
}

.user-profile { margin-top: auto; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 8px 10px; padding: 10px; border-radius: 10px; background: var(--subtle-bg); align-items: center; }
.user-profile .avatar { grid-row: 1; grid-column: 1; }
.user-profile .user-info { grid-row: 1; grid-column: 2; word-break: break-word; }
.user-profile .user-actions { grid-row: 2; grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-start; }
.user-profile .glass-btn-sm { flex-shrink: 0; }
.avatar { width: 35px; height: 35px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #000; font-weight: bold; flex-shrink: 0; }
body.light-theme .avatar { color: #fff; }

/* Light theme overrides for blocked elements */
body.light-theme #project-list li.has-blocked,
body.light-theme #project-list li.has-blocked.active,
body.light-theme #project-list li.has-blocked:hover {
    background: linear-gradient(90deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%) !important;
    color: #dc3545 !important;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.1);
}

body.light-theme .swimlane.has-blocked .swimlane-header {
    background: linear-gradient(90deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    color: #dc3545;
    box-shadow: 0 2px 15px rgba(220, 53, 69, 0.1);
}

body.light-theme .workflow-section.group-blocked:not(.collapsed) .workflow-header {
    background: linear-gradient(90deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    color: #dc3545;
    box-shadow: 0 2px 15px rgba(220, 53, 69, 0.1);
}

body.light-theme .workflow-section.group-blocked.collapsed {
    background: linear-gradient(90deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    box-shadow: 0 2px 15px rgba(220, 53, 69, 0.1);
}

body.light-theme .workflow-section.group-blocked.collapsed .workflow-header {
    color: #dc3545;
}

body.light-theme .workflow-section.group-blocked.collapsed .workflow-header span {
    text-shadow: none;
}

body.light-theme .dev-time-card-content {
    background: rgba(102, 126, 234, 0.08);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px;
    background: var(--subtle-bg);
    border-radius: 8px;
}
.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: var(--ease-out);
}
.theme-toggle:hover, .theme-toggle.active {
    opacity: 1;
    color: var(--accent);
}

/* Main Content */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; min-height: 0; transition: opacity 0.2s ease, transform 0.2s ease; }
.main-content.project-loading { opacity: 0; transform: translateY(5px); }
.main-content.hidden { display: none !important; }

.top-bar {
    padding: 15px 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    z-index: 5;
}

.top-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.controls-buttons { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Board & Swimlanes */
.board-container {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 20px 30px;
    min-height: 0; /* Fix flex scrolling */
}

.top-bar { background: none; }
.project-info h1 { color: var(--project-color); }
.deadline-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 15px;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

.swimlane {
    background: var(--subtle-bg);
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.swimlane.collapsed .swimlane-content { display: none; }

.swimlane-header {
    padding: 10px 20px;
    background: var(--hover-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: var(--accent);
}

.swimlane-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Backlog, Doing, Done */
    gap: 15px;
    padding: 15px;
    overflow-x: auto; /* Allow horizontal scroll if sections are wide */
    display: flex; /* Change to flex to support sections */
    align-items: stretch; /* Stretch sections to match the tallest one */
}

.workflow-section {
    background: var(--subtle-bg);
    border-radius: 8px;
    margin-right: 15px;
    display: flex;
    flex-direction: column;
    min-width: 300px; /* Width when expanded */
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.workflow-section.collapsed {
    min-width: 40px;
    width: 40px;
    cursor: pointer;
    background: var(--hover-bg);
}

.workflow-section.collapsed .workflow-columns { display: none; }
.workflow-section.collapsed .workflow-header {
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 10px 0;
    gap: 10px;
    background: none;
    border: none;
}

.workflow-header {
    padding: 10px;
    background: var(--hover-bg);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--subtle-border);
}

/* Blocked Workflow Section Styling - Futuristic */

/* When COLLAPSED - entire section has blocked design */
.workflow-section.group-blocked.collapsed {
    position: relative;
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(255, 75, 75, 0.2);
    border-radius: 8px;
}
.workflow-section.group-blocked.collapsed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 75, 75, 0.1) 25%,
        rgba(255, 150, 50, 0.1) 50%,
        rgba(255, 75, 75, 0.1) 75%,
        transparent 100%);
    animation: bannerShimmer 3s linear infinite;
    pointer-events: none;
    z-index: 0;
}
.workflow-section.group-blocked.collapsed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background: linear-gradient(90deg,
        #ff4b4b,
        #ff9f43,
        #ff4b4b,
        #ff9f43,
        #ff4b4b) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 200% 100%;
    animation: gradientFlow 2s linear infinite;
    pointer-events: none;
}
.workflow-section.group-blocked.collapsed .workflow-header {
    position: relative;
    z-index: 1;
    background: transparent;
    color: #ff6b6b;
}
.workflow-section.group-blocked.collapsed .workflow-header span {
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 75, 75, 0.5);
}

/* When EXPANDED - only header has blocked design */
.workflow-section.group-blocked:not(.collapsed) .workflow-header {
    position: relative;
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    color: #ff6b6b;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(255, 75, 75, 0.2);
    border-radius: 8px 8px 0 0;
}
.workflow-section.group-blocked:not(.collapsed) .workflow-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 75, 75, 0.1) 25%,
        rgba(255, 150, 50, 0.1) 50%,
        rgba(255, 75, 75, 0.1) 75%,
        transparent 100%);
    animation: bannerShimmer 3s linear infinite;
    pointer-events: none;
}
.workflow-section.group-blocked:not(.collapsed) .workflow-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        #ff4b4b,
        #ff9f43,
        #ff4b4b,
        #ff9f43,
        #ff4b4b);
    background-size: 200% 100%;
    animation: gradientFlow 2s linear infinite;
}
.workflow-section.group-blocked:not(.collapsed) .workflow-header span {
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 75, 75, 0.5);
}

/* Blocked Swimlane Header Styling */
.swimlane.has-blocked .swimlane-header {
    position: relative;
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    color: #ff6b6b;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(255, 75, 75, 0.2);
}
.swimlane.has-blocked .swimlane-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 75, 75, 0.08) 25%,
        rgba(255, 150, 50, 0.08) 50%,
        rgba(255, 75, 75, 0.08) 75%,
        transparent 100%);
    animation: bannerShimmer 4s linear infinite;
    pointer-events: none;
}
.swimlane.has-blocked .swimlane-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        #ff4b4b,
        #ff9f43,
        #ff4b4b,
        #ff9f43,
        #ff4b4b);
    background-size: 200% 100%;
    animation: gradientFlow 2s linear infinite;
}

.workflow-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Backlog, Doing, Done */
    gap: 10px;
    padding: 10px;
    min-width: 1000px; /* Ensure columns have space */
}

.column {
    background: var(--subtle-bg);
    border-radius: 10px;
    padding: 10px;
    min-height: 150px;
    min-width: 0;
}

.column-header {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: flex; justify-content: space-between; align-items: center;
}

/* Board Column Headers Color Coding */
.column[data-status*="backlog"] .column-header { border-left: 3px solid var(--text-muted); padding-left: 10px; }
.column[data-status*="doing"] .column-header { border-left: 3px solid var(--warning); padding-left: 10px; }
.column[data-status*="done"] .column-header { border-left: 3px solid var(--success); padding-left: 10px; }
/* Special case for shared columns */
.column[data-status="dev_done"][data-section="qa"] .column-header { border-left-color: var(--text-muted); }
.column[data-status="qa_done"][data-section="ops"] .column-header { border-left-color: var(--text-muted); }

/* Tasks */
.task-card {
    background: var(--glass-bg);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: grab;
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border-left: 4px solid transparent; /* For custom color */
    max-width: 300px;
}

/* Subtask Card Design */
.task-card.is-subtask {
    transform: scale(0.95);
    border: 1px dashed var(--subtle-border);
    background: rgba(255, 255, 255, 0.03);
}
.task-card.is-subtask::before {
    content: '↳';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}
.parent-link {
    font-size: 0.7rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.task-card.selected {
    border: 2px solid var(--accent);
    background: var(--active-bg);
}

.task-card:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--accent-glow);
    border-color: rgba(102, 126, 234, 0.3);
}

.task-card.dragging { opacity: 0.5; border: 1px dashed white; }

.task-tags { display: flex; gap: 5px; margin-bottom: 8px; }

/* Blocked Task Styling */
@keyframes pulse-blocked {
    0% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 75, 75, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0); }
}

.task-card.blocked {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(220, 53, 69, 0.05) 100%);
    border: 2px solid var(--danger) !important;
    animation: pulse-blocked 2s infinite;
}

.task-card.blocked .task-title {
    color: var(--danger);
    font-weight: bold;
}

.blocked-badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 5px;
}

.block-reason-text {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 5px;
    font-style: italic;
}

.tag { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; }
.tag.high { background: var(--danger); }
.tag.medium { background: var(--warning); color: black; }
.tag.low { background: var(--success); }
.tag.planning { background: var(--warning); color: black; }
.tag.active { background: var(--success); color: white;}
.tag.archived { background: var(--subtle-bg); color: var(--text-muted); }
body.light-theme .tag.medium, body.light-theme .tag.planning { color: #000; }

.task-group { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.task-title {
    font-weight: 600; font-size: 0.95rem; margin-bottom: 5px;
}
.task-meta { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }

.task-children-preview {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--subtle-border);
    font-size: 0.75rem;
}

/* Modal */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0); z-index: 100;
    display: flex; justify-content: center; align-items: center;
    animation: modalBackdropIn 0.25s ease-out forwards;
}
.modal.hidden { display: none !important; }
.modal-content {
    width: 1100px; max-width: 95%; height: 90vh; padding: 30px;
    position: relative; display: flex; flex-direction: column;
    animation: modalContentIn 0.3s ease-out forwards;
}

@keyframes modalBackdropIn {
    from { background: rgba(0,0,0,0); }
    to { background: rgba(0,0,0,0.6); }
}

@keyframes modalContentIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; }
.modal-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 20px; flex: 1; min-height: 0; }
.modal-main, .modal-sidebar { overflow-y: auto; padding-right: 5px; }
.modal-main textarea { width: 100%; height: 100px; margin-bottom: 15px; resize: none; }

/* Specific override for Team Modal to ensure it is wide enough */
#team-modal .modal-content {
    width: 900px;
    max-width: 95%;
}

.control-group { margin-bottom: 15px; display: flex; flex-direction: column; gap: 5px; }

.modal-header-title { margin-bottom: 10px; border-bottom: 1px solid var(--subtle-border); padding-bottom: 10px; outline: none; }
.modal-header-title:focus { border-bottom-color: var(--accent); }

.modal-section { margin-bottom: 25px; }
.modal-section-title { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; border-bottom: 1px solid var(--subtle-border); padding-bottom: 5px; font-weight: 600; }

.sidebar-group { background: var(--subtle-bg); padding: 15px; border-radius: 8px; margin-bottom: 15px; border: 1px solid var(--subtle-border); }
.sidebar-group label { display: block; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; font-weight: bold; }
.sidebar-group .control-group { margin-bottom: 10px; }
.sidebar-group .control-group:last-child { margin-bottom: 0; }

/* Subtasks */
.subtask-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; background: var(--subtle-bg); padding: 8px; border-radius: 6px; }

.subtask-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.subtask-item input[type="text"] { background: transparent; border: none; color: white; flex: 1; outline: none; }
body.light-theme .subtask-item input[type="text"] { color: #000; }
.subtask-item.done input[type="text"] { text-decoration: line-through; opacity: 0.6; }
.btn-delete-subtask { background: transparent; border: none; color: var(--danger); cursor: pointer; font-weight: bold; }

/* Subtask Links in Modal */
.subtask-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.subtask-link-item {
    background: var(--subtle-bg);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    border-left: 3px solid var(--accent);
}
.subtask-link-item:hover { background: var(--hover-bg); }

/* Chat / Comments */
.comments-section { display: flex; flex-direction: column; gap: 10px; max-height: 200px; overflow-y: auto; margin-bottom: 10px; padding-right: 5px; }
.chat-message { background: var(--input-bg); padding: 8px 12px; border-radius: 8px; font-size: 0.9rem; }
.chat-header { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.chat-input-area { display: flex; gap: 10px; }
.chat-input-area input { flex: 1; }

/* Admin Team List */
.team-list-admin { margin-top: 20px; overflow-y: auto; }
.team-item { background: var(--subtle-bg); padding: 10px; border-radius: 6px; margin-bottom: 10px; }
.team-item-header { font-weight: 600; display: flex; justify-content: space-between; margin-bottom: 5px; }
.team-members { font-size: 1rem; color: var(--text-muted); padding-left: 10px; }
.team-members li { list-style: none; }

/* Admin Sections */
.admin-section {
    transition: all 0.3s ease-in-out;
}
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 20px;
}
.admin-section-header h3 { margin: 0; }
.admin-section-header .toggle-icon { font-size: 1.5rem; transition: transform 0.3s ease-out; }
.admin-section.collapsed .toggle-icon { transform: rotate(-90deg); }
.admin-section-content {
    padding: 0 20px 20px 20px;
    opacity: 1;
    transition: opacity 0.3s ease-out, padding 0.3s ease-out;
}
.admin-section.collapsed .admin-section-content {
    display: none;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.admin-section:not(.collapsed) .admin-section-content {
    animation: adminSlideDown 0.35s ease-out;
}
@keyframes adminSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-grid {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Admin Header */
.admin-header {
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.admin-header h1 {
    font-size: 1.5rem;
    margin: 0;
}
.admin-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Calendar View */
.calendar-container { padding: 20px; height: 100%; overflow-y: auto; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(120px, auto); gap: 10px; }
.calendar-day { background: var(--subtle-bg); border-radius: 8px; padding: 10px; min-height: 120px; position: relative; border: 1px solid transparent; min-width: 0; overflow: hidden; }
.calendar-day.today { background: var(--hover-bg); border-color: var(--accent); }
.calendar-day-header { font-size: 0.8rem; font-weight: bold; margin-bottom: 8px; opacity: 0.7; text-align: right; }
.calendar-day-name { font-size: 0.7rem; text-transform: uppercase; margin-bottom: 5px; opacity: 0.5; text-align: center; }

.calendar-event { 
    font-size: 0.75rem; 
    padding: 4px 6px; 
    border-radius: 4px; 
    margin-bottom: 4px; 
    cursor: pointer; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: flex; 
    align-items: center; 
    gap: 5px;
    max-width: 100%;
}
.calendar-event.project-event { background: rgba(255, 159, 67, 0.3); border-left: 3px solid var(--project-color); }
.calendar-event.swimlane-event { background: rgba(0, 210, 255, 0.3); border-left: 3px solid var(--accent); }
.calendar-event:hover { opacity: 0.8; }

.calendar-legend { display: flex; gap: 15px; font-size: 0.8rem; color: var(--text-muted); margin-left: 20px; }

/* Timeline View */
.timeline-container { padding: 20px; height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 20px; }
.timeline-chart-wrapper {
    background: var(--subtle-bg);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: var(--glass-border);
    position: relative;
}
.timeline-header-row { display: flex; border-bottom: 1px solid var(--subtle-border); background: var(--hover-bg); }
.timeline-sidebar-header { width: 200px; padding: 10px; font-weight: bold; border-right: 1px solid var(--subtle-border); flex-shrink: 0; }
.timeline-timeline-header { flex: 1; padding: 10px; font-weight: bold; text-align: center; }

.timeline-body { overflow-y: auto; flex: 1; position: relative; }
.timeline-row { display: flex; border-bottom: 1px solid var(--subtle-border); height: 40px; align-items: center; position: relative; }
.timeline-row:hover { background: var(--subtle-bg); }
.timeline-label { width: 200px; padding: 0 10px; border-right: 1px solid var(--subtle-border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; font-size: 0.85rem; }
.timeline-track { flex: 1; position: relative; height: 100%; }

.timeline-bar {
    position: absolute; top: 8px; height: 24px;
    border-radius: 4px;
    font-size: 0.7rem; display: flex; align-items: center; padding: 0 8px;
    white-space: nowrap; overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: width 0.3s, left 0.3s;
}
.timeline-bar.project { background: var(--project-color); color: #fff; font-weight: bold; z-index: 2; }
body.light-theme .timeline-bar.project { color: #fff; }
.timeline-bar.swimlane { background: rgba(0, 210, 255, 0.3); border: 1px solid var(--accent); z-index: 1; }
.timeline-bar.endless { background: linear-gradient(90deg, var(--project-color) 0%, rgba(0,0,0,0) 100%); border-right: none; }
.timeline-bar.endless-swimlane { background: linear-gradient(90deg, rgba(0, 210, 255, 0.3) 0%, rgba(0,0,0,0) 100%); border-right: none; }

.timeline-today-line {
    position: absolute;
    top: 41px; /* Height of header row approx */
    bottom: 0;
    width: 2px;
    background: var(--danger);
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

/* List View */
.list-view-container { padding: 20px; height: 100%; overflow-y: auto; }
.list-project-section { margin-bottom: 20px; background: var(--subtle-bg); border-radius: 12px; overflow: hidden; border: var(--glass-border); }
.list-project-header { padding: 15px 20px; background: var(--hover-bg); display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.list-project-header h3 { margin: 0; font-size: 1.1rem; color: var(--project-color); }
.list-project-content { padding: 15px; }
.list-swimlane { margin-bottom: 15px; background: var(--subtle-bg); border-radius: 8px; overflow: hidden; }
.list-swimlane-header {
    padding: 10px 15px; background: var(--hover-bg); font-weight: 600; font-size: 0.95rem;
    color: var(--accent); display: flex; justify-content: space-between; align-items: center; cursor: pointer;
    transition: background 0.2s ease;
}
.list-swimlane-header:hover { background: var(--active-bg); }
.list-swimlane-header .toggle-icon { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: inline-block; }
.list-status-group { padding: 10px; border-bottom: 1px solid var(--subtle-border); min-height: 60px; }

.list-section-wrapper {
    border-left: 2px solid var(--subtle-border);
    margin-left: 10px;
    margin-top: 5px;
}
.list-section-wrapper.list-section-animate {
    animation: listSectionSlide 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.list-section-header {
    padding: 5px 10px; background: var(--subtle-bg);
    font-size: 0.8rem; font-weight: bold; color: var(--text-muted); text-transform: uppercase;
    cursor: pointer; display: flex; justify-content: space-between;
    transition: background 0.2s ease;
}
.list-section-header:hover { background: var(--hover-bg); }
.list-section-header .toggle-icon { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: inline-block; }

@keyframes listSectionSlide {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-status-group.list-status-animate {
    animation: listStatusSlide 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes listStatusSlide {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-status-header { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; padding-left: 10px; border-left: 3px solid var(--text-muted); font-weight: bold; }
.list-status-header[class*="backlog"] { border-color: var(--text-muted); }
.list-status-header[class*="doing"] { border-color: var(--warning); }
.list-status-header[class*="done"] { border-color: var(--success); }

.task-row {
    display: flex; align-items: center; gap: 15px;
    background: var(--hover-bg);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    cursor: grab;
    transition: background 0.2s;
    border: 1px solid transparent;
    border-left: 4px solid transparent;
}
.task-row.blocked {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid var(--danger);
    animation: pulse-blocked 2s infinite;
}
.task-row:hover { background: var(--hover-bg); }
.task-row.selected { background: var(--active-bg); border: 1px solid var(--accent); }
.task-row.dragging { opacity: 0.5; border: 1px dashed var(--text-color); }

/* Bulk Actions Bar */
.bulk-bar {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    padding: 15px 25px; z-index: 200; display: flex; gap: 20px; align-items: center;
    border-radius: 12px; width: auto; max-width: 90%;
    background: var(--glass-bg);
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-glow);
}
.bulk-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Fix dropdowns in bulk bar opening downwards off-screen */
.bulk-bar .custom-options {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 5px;
}

/* Notifications */
.notification-container { 
    position: fixed; top: 20px; right: 20px; z-index: 1000;
    display: flex; flex-direction: column; gap: 10px;
}
.notification-toast {
    background: var(--glass-bg);
    color: var(--text-color);
    padding: 12px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-out forwards;
    min-width: 250px;
    max-width: 400px;
    word-wrap: break-word;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Custom Selects */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    display: inline-block;
    min-width: 120px;
}
.custom-select-wrapper select { display: none; } /* Hide native */
.custom-select-trigger {
    background: var(--input-bg);
    border: var(--glass-border);
    color: var(--text-color);
    padding: 0 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    height: 35px;
    white-space: nowrap;
}
.custom-select-trigger:after {
    content: '▼'; font-size: 0.6rem; margin-left: 10px; opacity: 0.7;
}
.custom-options {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #2c2c2c;
    border: var(--glass-border);
    border-radius: 6px;
    z-index: 500;
    margin-top: 5px;
    max-height: 200px; overflow-y: auto;
    display: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    background: var(--glass-bg);
}
.custom-options.open { display: block; }
.custom-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid var(--subtle-border);
}
.custom-option:last-child { border-bottom: none; }
.custom-option:hover { background: var(--hover-bg); }
.custom-option.selected { background: var(--accent); color: #fff; font-weight: bold; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* Admin Project Board */
.admin-status-zone {
    background: var(--subtle-bg);
    border: 2px dashed var(--subtle-border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    min-height: 100px;
    transition: background 0.2s, border-color 0.2s;
}
.admin-status-zone.drag-over {
    background: var(--hover-bg);
    border-color: var(--accent);
}
.admin-status-header {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.admin-project-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    cursor: grab;
    border: var(--glass-border);
}
.admin-project-card:hover { border-color: var(--text-muted); }
.admin-project-card.dragging { opacity: 0.5; border: 1px dashed white; }

/* Time Analysis Cards */
.time-card {
    background: var(--hover-bg);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: background 0.2s;
}
.time-card:hover { background: var(--hover-bg); }
.time-card-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.time-card-header h3 { margin: 0; font-size: 1rem; color: var(--project-color); }
.time-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}
.time-card-grid > div {
    min-width: 0;
    overflow: hidden;
}
.task-time-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.task-time-title {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}
.task-time-hours {
    white-space: nowrap;
    flex-shrink: 0;
}
.time-card-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid var(--subtle-border);
    max-height: 50000px;
    opacity: 1;
    overflow: visible;
    transition: max-height 0.5s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
}
.time-card.collapsed .time-card-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}
.time-card .toggle-icon { transition: transform 0.3s; display: inline-block; margin-left: 10px; font-size: 0.8rem; opacity: 0.7; }
.time-card.collapsed .toggle-icon { transform: rotate(-90deg); }

/* Dev Time Cards */
.dev-time-card {
    background: var(--hover-bg);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid var(--subtle-border);
}
.dev-time-card-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}
.dev-time-card-header:hover { background: var(--hover-bg); }
.dev-time-card-content {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 50000px;
    opacity: 1;
    overflow: visible;
    transition: max-height 0.5s ease-out, opacity 0.25s ease-out, padding 0.25s ease-out;
}
.dev-time-card.collapsed .dev-time-card-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}
.dev-time-card .toggle-icon { font-size: 0.7rem; transition: transform 0.2s; }
.dev-time-card.collapsed .toggle-icon { transform: rotate(-90deg); }

/* Team View */
.team-view-container { padding: 40px; height: 100%; overflow-y: auto; }
.team-details-header { margin-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }
.team-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.detail-card { background: var(--hover-bg); border-radius: 12px; padding: 20px; }
.detail-card h3 { margin-bottom: 15px; color: var(--accent); border-bottom: 1px solid var(--subtle-border); padding-bottom: 10px; }
.member-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.member-table th { text-align: left; padding: 10px; color: var(--text-muted); border-bottom: 1px solid var(--subtle-border); }
.member-table td { padding: 10px; border-bottom: 1px solid var(--subtle-border); }
.project-list-simple { list-style: none; }
.project-list-simple li { padding: 10px; background: var(--subtle-bg); margin-bottom: 5px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; }
.project-list-simple li:hover { background: var(--hover-bg); cursor: pointer; }

/* Analytics View */
.analytics-container { padding: 30px; height: 100%; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-bottom: 100px; }
.chart-card { background: var(--glass-bg); border-radius: 12px; padding: 20px; border: var(--glass-border); display: flex; flex-direction: column; }
.chart-card.full-width { grid-column: span 2; }
.chart-header { margin-bottom: 20px; border-bottom: 1px solid var(--subtle-border); padding-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.chart-header h3 { color: var(--text-color); font-size: 1.1rem; }
.chart-body { flex: 1; min-height: 250px; position: relative; display: flex; align-items: center; justify-content: center; }

/* SVG Charts */
.cfd-chart { width: 100%; height: 100%; overflow: visible; }
.cfd-area { fill-opacity: 0.2; stroke-width: 2; }
.cfd-line { fill: none; stroke-width: 3; stroke-linecap: round; }
.cfd-axis { stroke: var(--subtle-border); stroke-width: 1; }
.cfd-label { font-size: 11px; font-weight: 500; }
.cfd-axis-label { fill: var(--text-muted); font-size: 9px; }
.cfd-axis-title { fill: var(--text-color); font-size: 11px; font-weight: 600; }
.cfd-tick { stroke: var(--subtle-border); stroke-width: 1; }
.cfd-grid { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 6, 4; opacity: 0.6; }
.cfd-tooltip { position: absolute; background: rgba(0,0,0,0.8); padding: 5px 10px; border-radius: 4px; font-size: 0.8rem; pointer-events: none; opacity: 0; transition: opacity 0.2s; border: 1px solid var(--accent); }

/* Performance Matrix */
.perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; width: 100%; }
.perf-card { background: var(--subtle-bg); border-radius: 8px; padding: 15px; display: flex; flex-direction: column; gap: 10px; border-left: 4px solid transparent; }
.perf-card.high-perf { border-left-color: var(--success); }
.perf-card.needs-help { border-left-color: var(--danger); }
.perf-card.steady { border-left-color: var(--warning); }

.perf-metric { display: flex; justify-content: space-between; font-size: 0.9rem; }
.perf-metric span:last-child { font-weight: bold; }
.perf-bar-bg { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.perf-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* Recommendation Box */
.rec-box { background: rgba(0, 210, 255, 0.1); border: 1px solid var(--accent); padding: 15px; border-radius: 8px; margin-bottom: 15px; }
.rec-title { font-weight: bold; color: var(--accent); margin-bottom: 5px; display: flex; align-items: center; gap: 10px; }
.rec-text { font-size: 0.9rem; opacity: 0.9; line-height: 1.5; }

.bottleneck-bar { display: flex; height: 30px; border-radius: 6px; overflow: hidden; margin-top: 10px; }
.bn-segment { display: flex; align-items: center; justify-content: center; font-size: 0.75rem; color: black; font-weight: bold; transition: width 0.5s; }

/* Forecast Modal */
.forecast-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.forecast-table th { text-align: left; padding: 10px; border-bottom: 1px solid var(--subtle-border); color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; }
.forecast-table td { padding: 12px 10px; border-bottom: 1px solid var(--subtle-border); }
.forecast-row:last-child td { border-bottom: none; }
.prob-badge { padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; display: inline-block; min-width: 80px; text-align: center; }
.prob-50 { background: rgba(255, 159, 67, 0.2); color: #ff9f43; border: 1px solid #ff9f43; }
.prob-85 { background: rgba(0, 210, 255, 0.2); color: #00d2ff; border: 1px solid #00d2ff; }
.prob-95 { background: rgba(32, 191, 107, 0.2); color: #20bf6b; border: 1px solid #20bf6b; }
.forecast-summary { display: flex; gap: 20px; margin-bottom: 20px; background: var(--subtle-bg); padding: 15px; border-radius: 8px; }
.forecast-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.forecast-stat span:first-child { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }
.forecast-stat span:last-child { font-size: 1.2rem; font-weight: bold; color: var(--text-color); }

/* ============================================
   RESPONSIVE DESIGN - Media Queries
   ============================================ */

/* Large screens and below (max-width: 1400px) */
@media (max-width: 1400px) {
    .modal-content { width: 95%; }
    .workflow-columns { min-width: 800px; }

    /* Top bar - responsive layout starts earlier */
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .project-info { width: 100%; }
    .project-info h1 { font-size: 1.4rem; }
    .controls {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .controls .glass-input,
    .controls .glass-select,
    .controls .custom-select-wrapper {
        flex: 1 1 calc(25% - 8px);
        min-width: 140px;
    }
    .controls .glass-btn {
        flex: 0 1 auto;
    }
}

/* Tablets and smaller laptops (max-width: 1200px) */
@media (max-width: 1200px) {
    .sidebar { width: 220px; padding: 15px; }
    .top-bar { padding: 15px 20px; }
    .board-container { padding: 15px 20px; }

    .analytics-container { grid-template-columns: 1fr; }
    .chart-card.full-width { grid-column: span 1; }

    .team-details-grid { grid-template-columns: 1fr; }

    .modal-grid { grid-template-columns: 1fr; }
    .modal-sidebar { border-top: 1px solid var(--subtle-border); padding-top: 20px; }

    .admin-grid { padding: 20px; }
    .admin-header { padding: 20px; }
    .admin-header h1 { font-size: 1.4rem; }
}

/* Tablets (max-width: 992px) */
@media (max-width: 992px) {
    /* Sidebar becomes collapsible overlay from the RIGHT */
    .sidebar {
        position: fixed;
        right: 0;
        left: auto;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    }
    /* Override collapsed state when mobile-open is active */
    .sidebar.collapsed.mobile-open {
        transform: translateX(0);
    }
    .sidebar.collapsed:not(.mobile-open) { transform: translateX(100%); }

    /* Show mobile menu toggle button */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Top bar row - full width to push menu toggle to right */
    .top-bar-row {
        width: 100%;
    }

    /* Sidebar close button - show X when sidebar is open */
    .sidebar.mobile-open #btn-toggle-sidebar {
        font-size: 0;
    }
    .sidebar.mobile-open #btn-toggle-sidebar::after {
        content: '✕';
        font-size: 1rem;
    }

    /* Reduce logo size on tablet to match mobile */
    .logo { font-size: 1.3rem; }

    /* Adjust main content */
    .main-content { margin-left: 0; }

    /* Top bar adjustments */
    .top-bar {
        padding: 15px;
    }
    .project-info h1 { font-size: 1.3rem; }
    .controls .glass-input,
    .controls .glass-select,
    .controls .custom-select-wrapper {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
    }
    .controls .glass-btn {
        flex: 1 1 auto;
    }

    /* Calendar - 4 columns on tablet */
    .calendar-container {
        grid-template-columns: repeat(4, 1fr);
        padding: 15px;
    }

    /* Timeline adjustments */
    .timeline-sidebar-header,
    .timeline-label { width: 150px; }

    /* Workflow sections */
    .workflow-section { min-width: 250px; }
    .workflow-columns { min-width: 600px; }

    /* List view */
    .list-view-container { padding: 15px; }

    /* Team view */
    .team-view-container { padding: 20px; }

    /* Admin header */
    .admin-header { padding: 15px; margin-bottom: 20px; }
    .admin-header h1 { font-size: 1.3rem; }
}

/* Small tablets / Large phones (max-width: 768px) */
@media (max-width: 768px) {
    /* Typography adjustments */
    .logo { font-size: 1.3rem; }
    .project-info h1 { font-size: 1.2rem; }

    /* Top bar */
    .top-bar { padding: 12px; }
    .top-bar-row {
        margin-bottom: 10px;
    }
    .top-bar-row .project-info {
        flex: 1;
        min-width: 0; /* Allow text to shrink */
    }
    .top-bar-row .project-info h1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .deadline-badge { display: none; }

    /* Controls - 2 column grid */
    .controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .controls .glass-input {
        grid-column: 1 / -1;
    }
    .controls-buttons {
        grid-column: 1 / -1;
        display: flex;
        gap: 6px;
    }
    .controls-buttons .glass-btn {
        flex: 1;
        font-size: 0.75rem;
        padding: 6px 8px;
        text-align: center;
    }

    /* Board container */
    .board-container { padding: 10px 15px; }

    /* Swimlane */
    .swimlane-header { padding: 10px 15px; font-size: 0.9rem; }
    .swimlane-content { padding: 10px; gap: 10px; }

    /* Workflow sections */
    .workflow-section { min-width: 220px; }
    .workflow-header { padding: 8px; font-size: 0.8rem; }
    .workflow-columns {
        min-width: 500px;
        gap: 8px;
        padding: 8px;
    }

    /* Task cards */
    .task-card {
        padding: 10px;
        max-width: 100%;
    }
    .task-title { font-size: 0.9rem; }
    .task-meta { font-size: 0.7rem; }

    /* Calendar - 2 columns on large phones */
    .calendar-container {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(100px, auto);
        gap: 8px;
    }
    .calendar-day { padding: 8px; min-height: 100px; }
    .calendar-day-header { font-size: 0.75rem; }
    .calendar-event { font-size: 0.7rem; padding: 3px 5px; }

    /* Timeline */
    .timeline-container { padding: 15px; }
    .timeline-sidebar-header,
    .timeline-label { width: 120px; font-size: 0.8rem; }
    .timeline-bar { font-size: 0.65rem; height: 20px; top: 10px; }

    /* List view */
    .task-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    .task-row > * { flex-shrink: 0; }

    /* Modal */
    .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
        padding: 20px;
    }
    .close-modal { top: 10px; right: 15px; font-size: 1.5rem; }
    .modal-header-title { font-size: 1.2rem; }

    /* Bulk actions bar */
    .bulk-bar {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: 100%;
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
    }
    .bulk-controls {
        width: 100%;
        justify-content: center;
    }

    /* Admin sections */
    .admin-section-header { padding: 15px; }
    .admin-section-content { padding: 0 15px 15px 15px; }

    /* Admin header */
    .admin-header {
        padding: 12px 15px;
        margin-bottom: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .admin-header h1 {
        font-size: 1.2rem;
        flex: 1;
        min-width: 0;
    }
    .admin-header-actions {
        gap: 8px;
    }
    .admin-header-actions .glass-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* Analytics */
    .analytics-container { padding: 15px; gap: 15px; }
    .chart-card { padding: 15px; }
    .chart-body { min-height: 200px; }

    /* Notifications */
    .notification-container {
        top: auto;
        bottom: 80px;
        left: 10px;
        right: 10px;
    }
    .notification-toast {
        min-width: auto;
        width: 100%;
    }
}

/* Mobile phones (max-width: 576px) */
@media (max-width: 576px) {
    /* Sidebar full width */
    .sidebar { width: 85%; max-width: 300px; }

    /* Top bar */
    .top-bar { padding: 10px; gap: 10px; }
    .project-info h1 { font-size: 1.1rem; word-break: break-word; }

    /* Controls - all full width */
    .controls { gap: 6px; }
    .controls .glass-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* Board */
    .board-container { padding: 8px 10px; }
    .swimlane { margin-bottom: 15px; border-radius: 8px; }
    .swimlane-header {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .swimlane-content { padding: 8px; }

    /* Workflow sections - narrower */
    .workflow-section { min-width: 180px; margin-right: 10px; }
    .workflow-columns { min-width: 400px; }
    .column { padding: 8px; min-height: 120px; }
    .column-header { font-size: 0.75rem; margin-bottom: 8px; }

    /* Task cards compact */
    .task-card { padding: 8px; margin-bottom: 8px; }
    .task-title { font-size: 0.85rem; margin-bottom: 3px; }
    .task-group { font-size: 0.65rem; }
    .task-meta { font-size: 0.65rem; margin-top: 5px; }
    .tag { font-size: 0.6rem; padding: 1px 4px; }

    /* Calendar - single column */
    .calendar-container {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .calendar-day { min-height: 80px; }

    /* Timeline - hide labels, show on hover/tap */
    .timeline-sidebar-header,
    .timeline-label { width: 80px; font-size: 0.7rem; padding: 0 5px; }
    .timeline-row { height: 35px; }

    /* List view compact */
    .list-view-container { padding: 10px; }
    .list-project-header { padding: 12px 15px; }
    .list-project-header h3 { font-size: 1rem; }
    .list-swimlane-header { padding: 8px 12px; font-size: 0.9rem; }
    .list-status-group { padding: 8px; }
    .task-row { padding: 8px 10px; gap: 6px; font-size: 0.85rem; }

    /* Modal adjustments */
    .modal-content { padding: 15px; }
    .modal-section { margin-bottom: 20px; }
    .modal-section-title { font-size: 0.8rem; }
    .sidebar-group { padding: 12px; }
    .sidebar-group label { font-size: 0.7rem; }

    /* Subtasks */
    .subtask-item { padding: 6px; gap: 8px; }

    /* Chat */
    .chat-input-area { flex-direction: column; gap: 8px; }
    .chat-input-area .glass-btn-sm { width: 100%; }

    /* Admin */
    .admin-grid { padding: 15px; gap: 15px; }
    .admin-section-header h3 { font-size: 1rem; }

    /* Admin header - stack on small screens */
    .admin-header {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 10px;
    }
    .admin-header h1 {
        font-size: 1.1rem;
        text-align: center;
    }
    .admin-header-actions {
        justify-content: space-between;
        width: 100%;
    }
    .admin-header-actions .glass-btn {
        flex: 1;
        text-align: center;
    }

    /* Team view */
    .team-view-container { padding: 15px; }
    .team-details-header { margin-bottom: 20px; padding-bottom: 15px; }
    .detail-card { padding: 15px; }
    .detail-card h3 { font-size: 1rem; }
    .member-table { font-size: 0.8rem; }
    .member-table th, .member-table td { padding: 8px 5px; }

    /* Analytics */
    .analytics-container { padding: 10px; gap: 10px; padding-bottom: 80px; }
    .chart-card { padding: 12px; }
    .chart-header h3 { font-size: 1rem; }
    .chart-body { min-height: 180px; }
    .perf-grid { grid-template-columns: 1fr; }

    /* Forecast */
    .forecast-summary { flex-direction: column; gap: 10px; }
    .forecast-table { font-size: 0.8rem; }
    .forecast-table th, .forecast-table td { padding: 8px 5px; }

    /* Bulk bar */
    .bulk-bar { padding: 10px 12px; gap: 8px; }
    .bulk-controls .glass-select,
    .bulk-controls .glass-btn {
        flex: 1 1 calc(50% - 5px);
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    /* User profile in sidebar */
    .user-profile { padding: 8px; gap: 8px; }
    .avatar { width: 30px; height: 30px; font-size: 0.8rem; }

    /* Custom selects */
    .custom-select-wrapper { min-width: 100px; }
    .custom-select-trigger { padding: 0 10px; height: 32px; font-size: 0.85rem; }
    .custom-option { padding: 8px 10px; font-size: 0.85rem; }
}

/* Very small phones (max-width: 400px) */
@media (max-width: 400px) {
    .project-info h1 { font-size: 1rem; }

    .workflow-section { min-width: 160px; }
    .workflow-columns { min-width: 350px; }

    .calendar-day { padding: 6px; }

    .timeline-sidebar-header,
    .timeline-label { width: 60px; font-size: 0.65rem; }

    /* Admin header */
    .admin-header h1 { font-size: 1rem; }
    .admin-header-actions .glass-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .bulk-controls .glass-select,
    .bulk-controls .glass-btn {
        flex: 1 1 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-section li { padding: 12px; }
    .glass-btn { padding: 10px 18px; }
    .glass-btn-sm { padding: 6px 10px; }
    .task-card { padding: 14px; }
    .task-row { padding: 12px 14px; }

    /* Remove hover effects that don't work well on touch */
    .task-card:hover {
        transform: none;
        box-shadow: none;
    }
    .task-row:hover {
        background: var(--hover-bg);
    }

    /* Disable grab cursor on touch */
    .task-card, .task-row { cursor: default; }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        height: 100vh;
        padding: 10px 20px;
    }
    .modal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    .sidebar-group { padding: 10px; margin-bottom: 10px; }

    .calendar-container { grid-auto-rows: minmax(80px, auto); }
}

/* Print styles */
@media print {
    .sidebar, .top-bar, .bulk-bar, .notification-container { display: none !important; }
    .main-content { margin: 0; padding: 20px; }
    .task-card { break-inside: avoid; }
}

/* SWOT Module Styles */
.swot-container {
    padding: 30px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 100px;
}

.swot-section {
    padding: 20px;
    border-radius: 12px;
}

.swot-context-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.swot-workspace {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    min-height: 500px;
}

.swot-brainstorm {
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.swot-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.swot-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
}

.swot-quadrant {
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.quadrant-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.swot-drop-zone {
    flex: 1;
    background: rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px;
    border: 1px dashed var(--subtle-border);
}

.swot-item {
    background: var(--glass-bg);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: grab;
    border: 1px solid var(--subtle-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.swot-item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.priority-indicator {
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    user-select: none;
}
.priority-indicator.p-1 { color: var(--success); } /* Low */
.priority-indicator.p-2 { color: var(--warning); } /* Med */
.priority-indicator.p-3 { color: var(--danger); }  /* High */
.priority-indicator:hover { opacity: 0.8; transform: scale(1.1); }

.delete-swot {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
}
.delete-swot:hover { color: var(--danger); }

.swot-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.swot-ai-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--subtle-border);
    animation: slideDown 0.3s ease-out;
}

.swot-generated-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 15px;
}

.swot-gen-card {
    background: var(--glass-bg);
    border: 1px solid var(--subtle-border);
    border-radius: 8px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.swot-gen-card.selected {
    box-shadow: 0 0 0 2px var(--accent);
    background: rgba(102, 126, 234, 0.05);
    border-color: var(--accent);
}

.swot-gen-card:not(.selected) {
    opacity: 0.6;
}

.gen-context-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--subtle-bg);
    color: var(--text-muted);
    margin-bottom: 8px;
    display: inline-block;
    text-transform: uppercase;
    font-weight: bold;
}

.swot-results-group {
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--subtle-border);
}

.swot-results-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--subtle-border);
}

.swot-results-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.swot-results-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.gen-subtasks {
    background: var(--subtle-bg);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.gen-subtasks ul { list-style: none; padding: 0; margin: 0; }
.gen-subtasks li { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 4px; color: var(--text-muted); }
.gen-subtasks li input { margin-top: 3px; }
.gen-subtasks label { display: block; font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; font-weight: bold; }

.ai-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ai-card {
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    background: rgba(102, 126, 234, 0.05);
}

.ai-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* SMART Objectives */
.smart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.smart-card {
    background: var(--glass-bg);
    border: 1px solid var(--subtle-border);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}
.smart-breakdown {
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.smart-field { margin-bottom: 4px; }
.smart-field strong { color: var(--accent); display: inline-block; width: 20px; font-weight: bold; }
.smart-statement {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--subtle-border);
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* SWOT Wizard */
.swot-wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    padding: 0 40px;
}
.swot-wizard-progress::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--subtle-border);
    z-index: 0;
}
.swot-step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 2px solid var(--subtle-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}
.swot-step-indicator.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    box-shadow: 0 0 10px var(--accent-glow);
}
.swot-step-indicator.completed {
    border-color: var(--success);
    background: var(--success);
    color: white;
}
.swot-step-label {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    white-space: nowrap;
    color: var(--text-muted);
}
.swot-step-indicator.active .swot-step-label { color: var(--accent); }

.ai-chat-interface { background: var(--subtle-bg); border-radius: 8px; padding: 15px; margin-top: 20px; border: 1px solid var(--subtle-border); }
.ai-message { display: flex; gap: 10px; margin-bottom: 10px; }
.ai-avatar { width: 30px; height: 30px; background: var(--accent-secondary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.ai-bubble { background: var(--glass-bg); padding: 10px 15px; border-radius: 0 12px 12px 12px; font-size: 0.9rem; border: 1px solid var(--subtle-border); max-width: 80%; }

@media (max-width: 992px) {
    .swot-workspace {
        grid-template-columns: 1fr;
    }
    .swot-matrix {
        min-height: 600px;
    }
}

/* SWOT Wizard Project Selection (Step 5) */
.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--subtle-border);
}

.modal-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 20px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.modal-tab-btn:hover { color: var(--text-color); background: var(--hover-bg); border-radius: 6px 6px 0 0; }
.modal-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.grid-col-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 768px) { .grid-col-2 { grid-template-columns: 1fr; } }
