/* =========================================================================
   Project Manager -- Dark Theme Stylesheet
   Professional charcoal/indigo palette, no decorative unicode
   ========================================================================= */

/* ---------------------------------------------------------------------------
   CSS Variables
   --------------------------------------------------------------------------- */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #252830;
    --bg-card: #1e2028;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: #2e3039;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --priority-1: #ef4444;  /* Critical */
    --priority-2: #f59e0b;  /* High */
    --priority-3: #6366f1;  /* Medium */
    --priority-4: #22c55e;  /* Low */
    --priority-5: #71717a;  /* Minimal */
    --sidebar-width: 260px;
    --topbar-height: 56px;
    --column-min-width: 280px;
}


/* ---------------------------------------------------------------------------
   Base Reset and Typography
   --------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}


/* ---------------------------------------------------------------------------
   App Layout
   --------------------------------------------------------------------------- */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.top-bar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.top-bar-brand {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
}

.top-bar-brand:hover {
    color: var(--accent);
}

.top-bar-separator {
    color: var(--text-muted);
    font-size: 14px;
}

.top-bar-project {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    min-width: 0;
}

.top-bar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.top-bar-link {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.top-bar-link:hover,
.top-bar-link.active {
    color: var(--text-primary);
}

.content {
    flex: 1;
    overflow: auto;
    padding: 24px;
}


/* ---------------------------------------------------------------------------
   Sidebar / Project List
   --------------------------------------------------------------------------- */
.sidebar-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.project-list {
    display: flex;
    flex-direction: column;
}

.project-list .sidebar-header + .project-item,
.project-list .sidebar-header + .sidebar-empty {
    margin-top: 0;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 0;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    transition: background 0.15s;
}

.project-item:hover {
    background: var(--bg-tertiary);
}

.project-item.active {
    background: var(--accent);
    color: white;
}

.project-item.active .project-code {
    color: rgba(255, 255, 255, 0.7);
}

.project-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-code {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
}

.sidebar-empty {
    padding: 16px;
    font-size: 13px;
}


/* ---------------------------------------------------------------------------
   Kanban Board
   --------------------------------------------------------------------------- */
.board {
    display: flex;
    gap: 16px;
    height: calc(100vh - var(--topbar-height) - 48px);
    min-height: 400px;
}

.board-column {
    min-width: var(--column-min-width);
    width: 20%;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.column-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.column-label {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.column-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}


/* ---------------------------------------------------------------------------
   Task Cards
   --------------------------------------------------------------------------- */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.task-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.task-priority-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 6px 6px 0 0;
}

.priority-1 { background: var(--priority-1); }
.priority-2 { background: var(--priority-2); }
.priority-3 { background: var(--priority-3); }
.priority-4 { background: var(--priority-4); }
.priority-5 { background: var(--priority-5); }

.task-title {
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    align-items: center;
}

.task-labels {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.label {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-secondary);
}

.task-assignee,
.task-due {
    color: var(--text-muted);
}

/* Sortable ghost/drag styles */
.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sortable-drag {
    opacity: 0.9;
}


/* ---------------------------------------------------------------------------
   Task Detail Panel (slide-in from right)
   --------------------------------------------------------------------------- */
.task-detail-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    max-width: 90vw;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    z-index: 200;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.task-detail-overlay.open {
    transform: translateX(0);
}

.task-detail-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    display: none;
}

.task-detail-backdrop.open {
    display: block;
}

.task-detail-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-detail-header h3 {
    font-size: 16px;
}

.task-detail-body {
    padding: 20px;
}

.task-detail-body .form-group {
    margin-bottom: 16px;
}

.task-detail-body label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.task-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}


/* ---------------------------------------------------------------------------
   Comments
   --------------------------------------------------------------------------- */
.comments {
    margin-top: 24px;
}

.comments h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.comment {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.comment:last-of-type {
    border-bottom: none;
}

.comment-author {
    font-weight: 500;
    font-size: 12px;
    color: var(--text-primary);
}

.comment-time {
    color: var(--text-muted);
    font-size: 11px;
}

.comment-body {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
}


/* ---------------------------------------------------------------------------
   Forms and Inputs
   --------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

input,
textarea,
select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.15s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2371717a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

textarea {
    resize: vertical;
    min-height: 60px;
}


/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.btn-icon:hover {
    color: var(--accent);
    background: var(--bg-tertiary);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}


/* ---------------------------------------------------------------------------
   Inline Form
   --------------------------------------------------------------------------- */
.inline-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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


/* ---------------------------------------------------------------------------
   Login Page
   --------------------------------------------------------------------------- */
.login-body {
    background: var(--bg-primary);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}


/* ---------------------------------------------------------------------------
   Projects Page
   --------------------------------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 20px;
}

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


.project-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.project-card-name {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-code {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}

.project-card-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.project-card-stats .stat {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

.new-project-form {
    margin-bottom: 16px;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
}


/* ---------------------------------------------------------------------------
   Settings Page
   --------------------------------------------------------------------------- */
.settings-container {
    max-width: 800px;
}

.settings-container h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.api-key-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

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

.new-key-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.new-key-code {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    word-break: break-all;
}


/* ---------------------------------------------------------------------------
   Alerts / Notifications
   --------------------------------------------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}


/* ---------------------------------------------------------------------------
   Count Badge
   --------------------------------------------------------------------------- */
.count-badge {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}


/* ---------------------------------------------------------------------------
   Utility Classes
   --------------------------------------------------------------------------- */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }


/* ---------------------------------------------------------------------------
   Scrollbar Styling (Webkit)
   --------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* ---------------------------------------------------------------------------
   Responsive Adjustments
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .board-column {
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .board {
        overflow-x: auto;
    }

    .board-column {
        min-width: 260px;
        flex-shrink: 0;
    }

    .task-detail-overlay {
        width: 100%;
        max-width: 100vw;
    }

    .top-bar {
        padding: 0 12px;
    }

    .top-bar-nav {
        gap: 8px;
    }

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


/* ---------------------------------------------------------------------------
   Project Card Actions
   --------------------------------------------------------------------------- */
.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
}

.project-card-link {
    display: block;
    padding: 20px 20px 12px 20px;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.project-card-link:hover {
    color: inherit;
}

.project-card:hover {
    border-color: var(--accent);
}

.project-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px 20px;
    justify-content: flex-end;
}

.project-card-path {
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ---------------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 480px;
    max-width: 90vw;
    z-index: 400;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
}

.modal-body {
    padding: 20px;
}


/* ---------------------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------------------- */
.dashboard-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    flex: 1;
    min-width: 140px;
    text-align: center;
}

.stat-card-danger {
    border-color: var(--danger);
}

.stat-card-warning {
    border-color: var(--warning);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card-danger .stat-value {
    color: var(--danger);
}

.stat-card-warning .stat-value {
    color: var(--warning);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.section-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.section-title-danger {
    color: var(--danger);
}

.section-title-warning {
    color: var(--warning);
}


/* ---------------------------------------------------------------------------
   Task List (dashboard style)
   --------------------------------------------------------------------------- */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-list-item {
    display: block;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.task-list-item:hover {
    background: var(--border);
    color: inherit;
}

.task-list-item-overdue {
    border-left-color: var(--danger);
}

.task-list-item-due-soon {
    border-left-color: var(--warning);
}

.task-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-list-title {
    font-size: 13px;
    font-weight: 500;
}

.task-list-project {
    font-size: 11px;
    color: var(--text-muted);
}

.task-list-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}


/* ---------------------------------------------------------------------------
   Activity Feed
   --------------------------------------------------------------------------- */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-action {
    display: flex;
    gap: 6px;
    align-items: baseline;
    flex-wrap: wrap;
}

.activity-actor {
    font-weight: 500;
    color: var(--text-primary);
}

.activity-verb {
    color: var(--text-secondary);
}

.activity-project {
    color: var(--accent);
    font-size: 12px;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}


/* ---------------------------------------------------------------------------
   Activity Side Panel (board page)
   --------------------------------------------------------------------------- */
.board-with-activity {
    display: flex;
    gap: 16px;
    height: calc(100vh - var(--topbar-height) - 96px);
    min-height: 400px;
}

.board-with-activity .board {
    flex: 1;
    height: 100%;
}

.activity-panel {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.activity-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.activity-panel-header h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.activity-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}


/* ---------------------------------------------------------------------------
   Board Filters
   --------------------------------------------------------------------------- */
.board-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-group input,
.filter-group select {
    width: 120px;
    padding: 4px 8px;
    font-size: 12px;
}


/* ---------------------------------------------------------------------------
   Due Date Visual Warnings
   --------------------------------------------------------------------------- */
.due-overdue {
    color: var(--danger);
    font-weight: 600;
}

.due-soon {
    color: var(--warning);
    font-weight: 600;
}


/* ---------------------------------------------------------------------------
   Search Bar
   --------------------------------------------------------------------------- */
.top-bar-search {
    flex: 1;
    max-width: 360px;
    margin: 0 16px;
    position: relative;
}

.top-bar-search input {
    width: 100%;
    padding: 6px 12px;
    font-size: 13px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
}

.top-bar-search input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 500;
    max-height: 400px;
    overflow-y: auto;
}

.search-section-label {
    padding: 8px 12px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.1s;
}

.search-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.search-item-title {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.search-item-meta {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 8px;
}

.search-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

@media (max-width: 768px) {
    .top-bar-search {
        display: none;
    }

    .dashboard-stats {
        flex-direction: column;
    }

    .board-filters {
        flex-direction: column;
        align-items: flex-start;
    }

    .activity-panel {
        display: none;
    }

    .board-with-activity {
        height: calc(100vh - var(--topbar-height) - 48px);
    }
}


/* ---------------------------------------------------------------------------
   Task Edit Modal
   --------------------------------------------------------------------------- */
.task-edit-modal {
    width: 560px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.task-edit-modal .form-group {
    margin-bottom: 12px;
}

.task-edit-modal label {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.task-edit-modal textarea {
    min-height: 120px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
}

.markdown-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    min-height: 120px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
    margin: 12px 0 6px;
    color: var(--text-primary);
}

.markdown-preview p {
    margin: 6px 0;
}

.markdown-preview code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.markdown-preview pre {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.markdown-preview pre code {
    padding: 0;
    background: none;
}

.markdown-preview ul,
.markdown-preview ol {
    padding-left: 20px;
    margin: 6px 0;
}

.markdown-preview blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    color: var(--text-secondary);
    margin: 8px 0;
}


/* ---------------------------------------------------------------------------
   Task Card Edit Button
   --------------------------------------------------------------------------- */
.task-edit-btn {
    margin-left: auto;
    font-size: 12px;
    padding: 2px 6px;
    opacity: 0;
    transition: opacity 0.15s;
}

.task-card:hover .task-edit-btn {
    opacity: 1;
}


/* ---------------------------------------------------------------------------
   Copy Project Code Button
   --------------------------------------------------------------------------- */
.copy-code-btn {
    font-size: 12px;
    padding: 2px 6px;
    margin-left: 4px;
}
