/* Launchpad — Project Manager */

/* ===== Toolbar ===== */
.toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===== Search ===== */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.6rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    width: 180px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand);
    width: 240px;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
}

.project-filter {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

/* ===== Dashboard ===== */
.dashboard-section {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.stat-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.dash-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.dash-panel {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.dash-panel h3 {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.dash-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 300px;
    overflow-y: auto;
}

.dash-list::-webkit-scrollbar { width: 6px; }
.dash-list::-webkit-scrollbar-track { background: transparent; }
.dash-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.dash-list::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

.dash-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.dash-item:hover {
    background: var(--accent-subtle, #f5f5f5);
}

.dash-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-item-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.dash-item-title {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.dash-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
}

/* ===== Project Grid ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem 0;
    max-height: 80vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.project-grid::-webkit-scrollbar {
    width: 5px;
}

.project-grid::-webkit-scrollbar-track {
    background: transparent;
}

.project-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.project-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.project-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-color, var(--brand));
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-top-row h3 {
    margin-bottom: 0;
    flex: 1;
}

.project-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--status-color, var(--green)) 12%, transparent);
    color: var(--status-color, var(--green));
    white-space: nowrap;
    border: 1px solid color-mix(in srgb, var(--status-color, var(--green)) 25%, transparent);
}

.project-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.project-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.project-card .card-actions {
    display: flex;
    gap: 0.5rem;
}

.project-card .card-actions button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.project-card .card-actions button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.project-card .card-actions button.delete-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ===== Activity Badges ===== */
.card-activity {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.pinned-note-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    background: var(--accent-subtle, #f5f5f5);
    border: 1px solid var(--border-color);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pinned-note-tag:hover {
    border-color: var(--card-color, var(--brand));
    color: var(--text-primary);
    background: #fff;
}

.posts-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    background: var(--accent-subtle, #f5f5f5);
    border: 1px solid var(--border-color);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.posts-badge:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: #fff;
}

/* ===== Task Progress Bar ===== */
.task-progress {
    margin-bottom: 1rem;
}

.task-progress-bar {
    display: flex;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border-color);
}

.task-progress-bar .bar-done {
    background: var(--green);
    transition: width 0.4s ease;
}

.task-progress-bar .bar-testing {
    background: var(--orange, #f59e0b);
    transition: width 0.4s ease;
}

.task-progress-bar .bar-in-progress {
    background: var(--blue);
    transition: width 0.4s ease;
}

.task-progress-bar .bar-todo {
    background: var(--text-muted);
    opacity: 0.35;
    transition: width 0.4s ease;
}

.task-progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* ===== Modal (site-specific) ===== */
#projectForm {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .modal-header,
    #projectForm,
    .modal-footer {
        padding: 1.5rem;
    }
}

/* ===== Co-op Badges ===== */
.coop-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--accent-subtle);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}

.card-top-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.role-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: capitalize;
    background: var(--accent-subtle);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.detail-shared-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem 1rem;
    background: var(--accent-subtle);
    border-radius: 6px;
    margin: 1rem 2rem 0 2rem;
}

/* ===== Co-op Members Section ===== */
.detail-members {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

.detail-members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.detail-members-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    margin: 0;
    color: var(--text-primary);
}

.member-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.member-list::-webkit-scrollbar { width: 6px; }
.member-list::-webkit-scrollbar-track { background: transparent; }
.member-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.member-list::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

.member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    transition: background 0.15s;
}

.member-item:hover {
    background: var(--accent-subtle);
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--card-color, var(--brand));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.owner-item .member-avatar {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--user-color, var(--card-color, var(--brand)));
}

.member-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.member-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-role {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: capitalize;
    background: var(--accent-subtle);
    padding: 0.1rem 0.45rem;
    border-radius: 8px;
}

.member-role.owner {
    color: var(--card-color, var(--brand));
    background: color-mix(in srgb, var(--card-color, var(--brand)) 10%, transparent);
}

.member-role-select {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
}

.member-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s;
}

.member-remove:hover {
    color: var(--red);
    background: rgba(193, 18, 31, 0.08);
}

.member-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem 0;
}

.invite-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.invite-form input {
    flex: 1;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
}

.invite-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent);
}

.invite-form select {
    padding: 0.45rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
}

/* ===== Expandable Member Items ===== */
.expandable-member {
    position: relative;
}

.member-expand-btn {
    background: none;
    border: none;
    padding: 0.2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: -0.35rem;
}

.member-expand-btn:hover {
    color: var(--text-primary);
}

.member-expand-btn.expanded {
    transform: rotate(180deg);
}

/* Member stats panel (expanded details) */
.member-stats-panel {
    padding: 0.75rem 0.75rem 0.5rem 0.5rem;
    background: var(--accent-subtle, #f9f9f9);
    animation: slideDown 0.25s ease-out;
    border-radius: 8px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.member-stats-loading,
.member-stats-error {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem 0;
}

.member-stats-content {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.member-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.member-stat-label {
    font-weight: 500;
    color: var(--text-primary);
}

.member-stat-value {
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

.member-stat-value:hover {
    text-decoration: underline;
}

/* Task progress bar for member */
.member-task-bar {
    display: flex;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--border-color);
}

.member-task-bar .bar-done {
    background: var(--green);
    transition: width 0.3s ease;
}

.member-task-bar .bar-testing {
    background: var(--orange, #f59e0b);
    transition: width 0.3s ease;
}

.member-task-bar .bar-in-progress {
    background: var(--blue);
    transition: width 0.3s ease;
}

.member-task-bar .bar-todo {
    background: var(--text-muted);
    opacity: 0.3;
    transition: width 0.3s ease;
}

.member-task-progress-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

/* ===== Project Contribution Bar ===== */
.project-contribution-bar-container {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 2rem 1.5rem 2rem;
    padding: 0.75rem;
    background: var(--accent-subtle);
    border-radius: 8px;
}

.project-contribution-bar-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-contribution-bar {
    display: flex;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.contribution-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    min-width: 30px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.contribution-segment:hover {
    filter: brightness(1.1);
    box-shadow: inset 0 0 12px rgba(0,0,0,0.2);
}

.contribution-segment .contribution-tooltip {
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    margin-bottom: 0.5rem;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.contribution-segment:hover .contribution-tooltip {
    opacity: 1;
}

.contribution-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.contribution-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.contribution-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ===== Detail: Chat Items ===== */
.detail-chat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

.detail-chat-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-chat-preview {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-chat-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== Footer Links ===== */
.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        white-space: nowrap;
    }

    /* Card: better touch targets */
    .project-card .card-actions button {
        padding: 0.35rem 0.6rem;
        font-size: 0.78rem;
    }

    .footer-links {
        display: none;
    }

    .invite-form {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .invite-form input,
    .invite-form select {
        max-width: 100%;
    }

    .invite-form input {
        flex: 0 1 calc(50% - 0.35rem);
        min-width: 0;
    }

    .invite-form select {
        flex: 0 1 auto;
    }

    .invite-form .btn-sm {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* ===== Detail Panel (slide-in overlay) ===== */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detail-panel.open {
    opacity: 1;
}

.detail-panel-content {
    width: 500px;
    max-width: 90%;
    background: var(--surface, #fff);
    height: 100%;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid var(--card-color, var(--brand));
}

.detail-panel.open .detail-panel-content {
    transform: translateX(0);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--accent-subtle, #f5f5f5);
}

.detail-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    border: none;
    padding: 0;
}

.detail-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.detail-close:hover {
    color: var(--text-primary);
    background: #fff;
    transform: rotate(90deg);
}

.detail-desc {
    padding: 1.5rem 2rem 0;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.75rem;
    padding: 1.5rem 2rem;
}

.detail-stat {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--accent-subtle, #f5f5f5);
    border-radius: 8px;
}

.detail-stat-num {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.detail-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: block;
    margin-top: 0.15rem;
}

.detail-links {
    display: flex;
    gap: 0.75rem;
    padding: 0 2rem 1.5rem;
}

.detail-links .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    padding: 0.6rem 1rem;
    text-decoration: none;
}

.detail-github-link {
    padding: 0 2rem 1rem;
}

.btn-github {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: #1f1f1f;
    color: #fff;
    border: 1px solid #333;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-github:hover {
    background: #2d2d2d;
    border-color: #444;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.detail-meta {
    padding: 1rem 2rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* ===== Detail: Pinned Note ===== */
.detail-pinned {
    padding: 0 2rem 1rem;
}

.detail-pinned-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: var(--accent-subtle, #f5f5f5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.detail-pinned-link:hover {
    border-color: var(--card-color, var(--brand));
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.detail-pinned-title {
    font-size: 0.88rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Detail: Quick Actions ===== */
.detail-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem 1rem;
}

.detail-delete-btn {
    color: var(--text-muted) !important;
}

.detail-delete-btn:hover {
    color: var(--red) !important;
    border-color: var(--red) !important;
}

/* ===== Detail: Sections (Tasks, Posts, Milestones) ===== */
.detail-section {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border-color);
}

.detail-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

.detail-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 250px;
    overflow-y: auto;
}

.detail-items-list::-webkit-scrollbar { width: 5px; }
.detail-items-list::-webkit-scrollbar-track { background: transparent; }
.detail-items-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.detail-items-loading,
.detail-items-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.75rem 0;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.detail-item:hover {
    background: var(--accent-subtle, #f5f5f5);
}

.detail-item-done {
    opacity: 0.55;
}

.detail-item-done .detail-item-title {
    text-decoration: line-through;
}

.detail-item-title {
    flex: 1;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-item-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.detail-item-deadline {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Task status dots */
.task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== Color Picker ===== */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    background-clip: border-box;
}

.color-swatch:hover {
    transform: scale(1.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--text-muted);
}

.color-swatch.selected {
    border-color: var(--brand);
    border-width: 3px;
    transform: scale(1.12);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}

.task-dot-todo {
    background: var(--text-muted);
    opacity: 0.5;
}

.task-dot-progress {
    background: var(--blue);
}

.task-dot-done {
    background: var(--green);
}

.task-dot-testing {
    background: var(--orange, #f59e0b);
}

/* Post status badges */
.detail-post-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.detail-post-badge.published {
    background: color-mix(in srgb, var(--green) 12%, transparent);
    color: var(--green);
}

.detail-post-badge.draft {
    background: color-mix(in srgb, var(--yellow) 15%, transparent);
    color: var(--yellow);
}

/* ===== Detail: Milestones ===== */
.detail-milestone {
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.detail-milestone:hover {
    background: var(--accent-subtle, #f5f5f5);
}

.detail-milestone.milestone-overdue {
    background: color-mix(in srgb, var(--red) 5%, transparent);
}

.detail-milestone-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-milestone-title {
    flex: 1;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-milestone-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.detail-milestone-date.overdue {
    color: var(--red);
    font-weight: 600;
}

.detail-milestone-bar {
    height: 5px;
    border-radius: 3px;
    background: var(--border-color);
    margin-top: 0.4rem;
    overflow: hidden;
    display: flex;
}

.detail-milestone-fill {
    height: 100%;
    background: var(--green);
    transition: width 0.4s ease;
}

.detail-milestone-fill-todo {
    height: 100%;
    background: var(--text-muted);
    opacity: 0.4;
    transition: width 0.4s ease;
}

.detail-milestone-fill-progress {
    height: 100%;
    background: var(--blue);
    transition: width 0.4s ease;
}

.detail-milestone-fill-testing {
    height: 100%;
    background: var(--orange, #f59e0b);
    transition: width 0.4s ease;
}

.detail-milestone-progress {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: block;
}

/* ===== Responsive Additions ===== */
@media (max-width: 768px) {
    /* Dashboard panels: horizontal scroll */
    .dash-panels {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        margin: 0 -4%;
        padding: 0 4% 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    .dash-panel {
        min-width: 75vw;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Toolbar: 2-row layout */
    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .search-wrap {
        grid-column: 1 / -1;
    }

    .search-input {
        width: 100%;
    }

    .search-input:focus {
        width: 100%;
    }

    .project-filter {
        width: 100%;
    }

    #newProjectBtn {
        width: 100%;
        justify-content: center;
    }

    .detail-panel-content {
        width: 100%;
        max-width: 100%;
    }
}

/* ===== Widescreen Layout ===== */
@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }

    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .dash-stats {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}
