/* ── Projects Index page ─────────────────────────────────────────────────── */

/* Filter sidebar */
.pi-filter-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 18px 16px;
    position: sticky;
    top: 16px;
}

.pi-filter-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pi-filter-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #aaa;
    margin: 14px 0 8px;
}

.pi-filter-section-label:first-of-type {
    margin-top: 0;
}

/* Status checkboxes */
.pi-status-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pi-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 7px;
    border-radius: 7px;
    transition: background 0.15s;
    user-select: none;
}

.pi-status-item:hover { background: #f4f6f8; }

.pi-status-item input[type="checkbox"] { display: none; }

.pi-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pi-status-name {
    font-size: 13px;
    color: #555;
    flex: 1;
}

.pi-status-count {
    font-size: 11px;
    font-weight: 700;
    background: #eef0f3;
    color: #888;
    border-radius: 20px;
    padding: 1px 7px;
    min-width: 22px;
    text-align: center;
}

.pi-status-item.pi-active .pi-status-count {
    background: #d6e4f5;
    color: #1a3a5c;
}

.pi-check-icon {
    font-size: 12px;
    color: #1a3a5c;
    opacity: 0;
    transition: opacity 0.15s;
}

.pi-status-item.pi-active .pi-check-icon { opacity: 1; }
.pi-status-item.pi-active .pi-status-name { font-weight: 600; color: #1a3a5c; }
.pi-status-item.pi-active { background: #eef4fb; }

.pi-sort-select {
    width: 100%;
    font-size: 13px;
    border: 1px solid #d8dde4;
    border-radius: 7px;
    padding: 7px 10px;
    background: #fafbfc;
    color: #444;
    cursor: pointer;
    transition: border-color 0.15s;
}

.pi-sort-select:focus {
    outline: none;
    border-color: #1a3a5c;
    box-shadow: 0 0 0 2px rgba(26,58,92,0.1);
}

/* Page header */
.pi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
}

.pi-header-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.pi-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

.pi-count {
    font-size: 13px;
    color: #aaa;
}

.pi-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #1a3a5c, #2d6ea8);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.pi-add-btn:hover { color: #fff; opacity: 0.9; }

/* Card grid — max 3 columns */
.pi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) {
    .pi-grid { grid-template-columns: repeat(2, 1fr); }
}

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

/* Project card */
.pi-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-left: 4px solid #6c757d;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.15s;
    overflow: hidden;
}

.pi-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    color: inherit;
    text-decoration: none;
}

.pi-card[data-status="Not_started"] { border-left-color: #6c757d; }
.pi-card[data-status="In_progress"] { border-left-color: #007bff; }
.pi-card[data-status="Completed"]   { border-left-color: #28a745; }
.pi-card[data-status="On_hold"]     { border-left-color: #fd7e14; }
.pi-card[data-status="Cancelled"]   { border-left-color: #dc3545; }

.pi-card-header {
    padding: 16px 18px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.pi-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.pi-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.pi-badge-not-started { background: #f0f0f0; color: #666; }
.pi-badge-in-progress { background: #e8f0fe; color: #1a3a5c; }
.pi-badge-completed   { background: #e6f4ea; color: #1e7e34; }
.pi-badge-on-hold     { background: #fff3e0; color: #c25d00; }
.pi-badge-cancelled   { background: #fdecea; color: #b71c1c; }

.pi-card-meta {
    padding: 4px 18px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    flex: 1;
}

.pi-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pi-meta-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #bbb;
}

.pi-meta-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.pi-card-footer {
    padding: 10px 18px;
    background: #f8f9fb;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #aaa;
}

/* Empty state */
.pi-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}

.pi-empty i { font-size: 48px; display: block; margin-bottom: 14px; }
.pi-empty-title { font-size: 15px; font-weight: 600; color: #aaa; margin-bottom: 6px; }
.pi-empty-sub { font-size: 13px; color: #bbb; }

/* ── Dark mode ───────────────────────────────────────────────────────────── */

[data-theme="dark"] .pi-filter-panel {
    background: #1e1e2e;
    border-color: #2d2d4e;
}

[data-theme="dark"] .pi-filter-title { color: #555; }
[data-theme="dark"] .pi-filter-section-label { color: #444; }

[data-theme="dark"] .pi-status-item:hover { background: #252540; }
[data-theme="dark"] .pi-status-item.pi-active { background: #1e2a3a; }
[data-theme="dark"] .pi-status-name { color: #a0a0c0; }
[data-theme="dark"] .pi-status-item.pi-active .pi-status-name { color: #7aabf0; }
[data-theme="dark"] .pi-check-icon { color: #7aabf0; }
[data-theme="dark"] .pi-status-count { background: #252535; color: #555; }
[data-theme="dark"] .pi-status-item.pi-active .pi-status-count { background: #1e2a3a; color: #7aabf0; }

[data-theme="dark"] .pi-sort-select {
    background: #252535;
    border-color: #3d3d5e;
    color: #c0c0d8;
}

[data-theme="dark"] .pi-page-title { color: #e0e0e8; }
[data-theme="dark"] .pi-count { color: #555; }

[data-theme="dark"] .pi-card {
    background: #1e1e2e;
    border-color: #2d2d4e;
}

[data-theme="dark"] .pi-card-name { color: #e0e0e8; }
[data-theme="dark"] .pi-meta-label { color: #444; }
[data-theme="dark"] .pi-meta-value { color: #c0c0d8; }

[data-theme="dark"] .pi-card-footer {
    background: #15152a;
    border-top-color: #2d2d4e;
    color: #555;
}

[data-theme="dark"] .pi-badge-not-started { background: #252535; color: #777; }
[data-theme="dark"] .pi-badge-in-progress { background: #1e2a3a; color: #7aabf0; }
[data-theme="dark"] .pi-badge-completed   { background: #1a2e20; color: #6ddb8a; }
[data-theme="dark"] .pi-badge-on-hold     { background: #2e2010; color: #ffa040; }
[data-theme="dark"] .pi-badge-cancelled   { background: #2e1520; color: #f08090; }
