/* ═══════════════════════════════════════════
   MobvenAI Governor — Dark Space Theme
   ═══════════════════════════════════════════ */

:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-glow: rgba(108, 99, 255, 0.3);
    --bg: #0a0a0f;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f0f0f5;
    --text-muted: #8888aa;
    --border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.06);
    --backend-accent: #6366f1;
    --client-accent: #10b981;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;

    /* Dark theme (system-status dashboard) */
    --bg-dark: #0f172a;
    --surface: #1e293b;
    --surface-alt: #334155;
    --surface-border: #475569;
    --text: #f1f5f9;
    --accent: #38bdf8;
    --green: #4ade80;
    --green-glow: rgba(74, 222, 128, 0.15);
    --yellow: #facc15;
    --yellow-glow: rgba(250, 204, 21, 0.15);
    --red: #f87171;
    --red-glow: rgba(248, 113, 113, 0.15);
}

#starfield { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container { width: 100%; max-width: 900px; padding: 40px 20px; position: relative; z-index: 1; }

header { text-align: center; margin-bottom: 40px; }

h1 { font-weight: 600; font-size: 2.5rem; margin-bottom: 4px; color: #fff; letter-spacing: -0.02em; }
h1 span.accent { color: var(--primary); }
.header-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-top: 0; }

/* Navigation */
.nav-bar { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.nav-link { color: var(--text-muted); text-decoration: none; padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 500; transition: all 0.2s; border: 1px solid transparent; }
.nav-link:hover { color: var(--text-main); background: var(--card-bg); border-color: var(--card-border); }
.nav-link.active { color: var(--primary); background: rgba(108, 99, 255, 0.1); border-color: rgba(108, 99, 255, 0.2); }

.main-card {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.input-project-name, .input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    background: var(--input-bg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 12px;
}

.input-project-name:focus, .input-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.input-project-name::placeholder, .input-field::placeholder { color: var(--text-muted); }

textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    background: var(--input-bg);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
textarea::placeholder { color: var(--text-muted); }

/* Buttons */
.btn-submit, .btn-primary { background: var(--primary); color: white; border: none; width: 100%; padding: 14px; border-radius: 12px; font-weight: 600; font-size: 1rem; margin-top: 16px; cursor: pointer; transition: all 0.2s; }
.btn-submit:hover, .btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 20px var(--primary-glow); }
.btn-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--border); padding: 10px 20px; border-radius: 10px; font-weight: 500; font-size: 0.9rem; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); padding: 8px 16px; border-radius: 8px; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.1); border-color: var(--danger); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; margin-top: 0; width: auto; }

/* Platform Selection */
.platform-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 768px) { .platform-row { grid-template-columns: 1fr; } }
.platform-group { display: flex; flex-direction: column; gap: 6px; }
.platform-label, .form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.select-wrapper { position: relative; }
.select-wrapper select { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; font-family: inherit; font-size: 1rem; color: var(--text-main); background: var(--input-bg); appearance: none; -webkit-appearance: none; cursor: pointer; outline: none; transition: border-color 0.2s; }
.select-wrapper select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.select-wrapper::after { content: ''; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--text-muted); pointer-events: none; }

/* Image Upload */
.upload-area { margin-top: 16px; border: 2px dashed var(--border); border-radius: 12px; padding: 20px; text-align: center; transition: border-color 0.2s, background 0.2s; cursor: pointer; }
.upload-area:hover { border-color: var(--primary); background: rgba(108, 99, 255, 0.05); }
.upload-area input[type="file"] { display: none; }
.upload-label { font-size: 0.95rem; color: var(--text-muted); cursor: pointer; }
.upload-label strong { color: var(--primary); }
.preview-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.preview-item { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }

/* Results */
.results-area { margin-top: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; animation: fadeIn 0.5s ease-out; }
@media (max-width: 768px) { .results-area { grid-template-columns: 1fr; } }
.result-box { background: var(--card-bg); border-radius: 12px; border: 1px solid var(--card-border); overflow: hidden; }
.result-header { padding: 12px 16px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: white; }
.backend-header { background: var(--backend-accent); }
.client-header { background: var(--client-accent); }
.result-content { padding: 16px; font-family: 'JetBrains Mono', 'Monaco', monospace; font-size: 0.85rem; background: rgba(0, 0, 0, 0.2); color: var(--text-muted); min-height: 150px; white-space: pre-line; }

/* Setup Status */
.setup-status-area { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; animation: fadeIn 0.5s ease-out; }
.setup-status-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--card-bg); }
.setup-status-box.setup-created { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.2); }
.setup-status-box.setup-existing { background: rgba(108, 99, 255, 0.08); border-color: rgba(108, 99, 255, 0.2); }
.setup-status-icon { font-size: 1.5rem; flex-shrink: 0; }
.setup-status-text { display: flex; flex-direction: column; gap: 2px; }
.setup-status-text strong { font-size: 0.9rem; color: var(--text-main); }
.setup-status-text span { font-size: 0.8rem; color: var(--text-muted); }

/* Agent Output */
.agent-output-section { border-top: 1px solid var(--card-border); }
.agent-output-label { padding: 8px 16px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: rgba(0, 0, 0, 0.15); }
.agent-output-content { padding: 16px; font-family: 'JetBrains Mono', 'Monaco', monospace; font-size: 0.8rem; color: var(--text-muted); white-space: pre-line; }

/* ═══ Admin Dashboard ═══ */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
@media (max-width: 768px) { .stats-grid { grid-template-columns: 1fr; } }
.stat-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 20px; text-align: center; backdrop-filter: blur(12px); }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title { font-size: 1.1rem; font-weight: 600; color: var(--text-main); margin: 0; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 16px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 16px; font-size: 0.9rem; color: var(--text-main); border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-accepted { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-expired { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-role { background: rgba(108, 99, 255, 0.15); color: var(--primary); border: 1px solid rgba(108, 99, 255, 0.3); }
.badge-admin { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }

/* Invite Form */
.invite-form-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 24px; margin-bottom: 24px; backdrop-filter: blur(12px); position: relative; z-index: 10; overflow: visible; }
.invite-form-card h3 { margin: 0 0 16px 0; font-size: 1rem; font-weight: 600; color: var(--text-main); }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; position: relative; }
@media (max-width: 768px) { .form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 6px; }

/* Accept Page */
.accept-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; }
.accept-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 20px; padding: 40px; width: 100%; max-width: 420px; backdrop-filter: blur(12px); text-align: center; }
.accept-card h2 { font-size: 1.5rem; margin: 0 0 8px 0; color: var(--text-main); }
.accept-card .subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.accept-card .input-field { text-align: left; }
.accept-card .project-info { background: rgba(108, 99, 255, 0.08); border: 1px solid rgba(108, 99, 255, 0.2); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.accept-card .project-info strong { color: var(--primary); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 16px; }
.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); }
.alert-success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--success); }

/* Utilities */
.action-buttons { display: flex; gap: 8px; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }

/* ═══ Project Picker (custom multi-select with chips) ═══ */
.project-picker { position: relative; }

.project-picker-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 46px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--input-bg); cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}
.project-picker-toggle:hover { border-color: rgba(255,255,255,0.18); }
.project-picker-toggle:focus,
.project-picker.open .project-picker-toggle {
    border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); outline: none;
}

.project-picker-chips {
    display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-width: 0;
}

.project-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
    white-space: nowrap; animation: chipIn 0.15s ease-out;
    letter-spacing: 0.02em;
}
.project-chip--all {
    background: rgba(108, 99, 255, 0.15); color: var(--primary);
    border: 1px solid rgba(108, 99, 255, 0.25);
}
.project-chip--project {
    background: rgba(16, 185, 129, 0.12); color: var(--client-accent);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.project-chip--count {
    background: rgba(136, 136, 170, 0.12); color: var(--text-muted);
    border: 1px solid rgba(136, 136, 170, 0.2);
}

@keyframes chipIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.project-picker-arrow {
    width: 10px; height: 10px; flex-shrink: 0; position: relative;
    border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg); transition: transform 0.25s; margin-top: -3px;
}
.project-picker.open .project-picker-arrow {
    transform: rotate(-135deg); margin-top: 3px;
}

.project-picker-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: rgba(18, 18, 35, 0.97); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px; padding: 8px; z-index: 100;
    max-height: 220px; overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 0 0 1px rgba(108,99,255,0.08);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    animation: dropIn 0.2s ease-out;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.project-picker.open .project-picker-dropdown { display: block; }

.project-picker-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; cursor: pointer; font-size: 0.88rem;
    color: var(--text-main); transition: all 0.12s; border-radius: 8px; margin: 1px 0;
}
.project-picker-item:hover { background: rgba(108, 99, 255, 0.1); }
.project-picker-item.checked { background: rgba(108, 99, 255, 0.06); }

.project-picker-item input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.15); border-radius: 6px; background: transparent;
    cursor: pointer; position: relative; flex-shrink: 0;
    transition: all 0.15s;
}
.project-picker-item input[type="checkbox"]:hover { border-color: rgba(255,255,255,0.3); }
.project-picker-item input[type="checkbox"]:checked {
    background: var(--primary); border-color: var(--primary);
    box-shadow: 0 0 8px rgba(108, 99, 255, 0.35);
}
.project-picker-item input[type="checkbox"]:checked::after {
    content: ''; position: absolute; left: 5px; top: 2px;
    width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.project-picker-divider {
    height: 1px; background: rgba(255,255,255,0.06); margin: 6px 4px;
}

.project-picker-dropdown::-webkit-scrollbar { width: 5px; }
.project-picker-dropdown::-webkit-scrollbar-track { background: transparent; }
.project-picker-dropdown::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.project-picker-dropdown::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   Sidebar Layout
   ═══════════════════════════════════════════ */

body.has-sidebar {
    display: block;
}

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px; z-index: 200;
    background: rgba(10, 10, 20, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    display: flex; flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.sidebar-logo-icon {
    font-size: 1.5rem;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(108, 99, 255, 0.12);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 12px;
}

.sidebar-logo-text {
    display: flex; flex-direction: column;
}

.sidebar-logo-title {
    font-size: 1.05rem; font-weight: 700; color: #fff; letter-spacing: -0.01em;
}

.sidebar-logo-sub {
    font-size: 0.72rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 10px;
    color: var(--text-muted); text-decoration: none;
    font-size: 0.88rem; font-weight: 500;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(108, 99, 255, 0.15);
    box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.2);
}

.sidebar-link.active .sidebar-link-icon {
    color: var(--primary);
}

.sidebar-link-icon {
    width: 20px; height: 20px; flex-shrink: 0;
    stroke-width: 1.8;
}

/* Sidebar Footer — User Info */
.sidebar-footer {
    padding: 16px 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex; align-items: center; gap: 10px;
}

.sidebar-user {
    flex: 1; display: flex; align-items: center; gap: 10px;
    min-width: 0;
}

.sidebar-avatar {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: #fff;
    letter-spacing: 0.03em;
}

.sidebar-avatar--sm {
    width: 32px; height: 32px; font-size: 0.7rem; border-radius: 8px;
}

.sidebar-user-info {
    display: flex; flex-direction: column; min-width: 0;
}

.sidebar-user-name {
    font-size: 0.82rem; font-weight: 600; color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.7rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-logout-form {
    margin: 0;
}

.sidebar-logout-btn {
    background: none; border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px; padding: 7px; cursor: pointer;
    color: var(--text-muted); transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}

.sidebar-logout-btn:hover {
    color: var(--danger); border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

/* Main Content Area (with sidebar offset) */
.admin-main {
    margin-left: 260px;
    padding: 40px 32px;
    position: relative; z-index: 1;
    max-width: 1100px;
}

/* Orchestrator — narrower, centered content */
.orchestrator-main {
    max-width: 960px;
}
.orchestrator-main header { text-align: center; margin-bottom: 40px; }

/* ═══ Page Header ═══ */
.page-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 28px; }
.page-title { font-size: 1.6rem; font-weight: 700; color: #fff; margin: 0; }
.page-count { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

/* ═══ Project Cards Grid ═══ */
.project-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}

.project-card {
    display: flex; flex-direction: column; position: relative;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px;
    padding: 20px; text-decoration: none; color: inherit;
    transition: all 0.2s ease; cursor: pointer;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.project-card:hover {
    border-color: rgba(108, 99, 255, 0.3);
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.project-card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.project-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(108, 99, 255, 0.12); border: 1px solid rgba(108, 99, 255, 0.2);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.project-card-date {
    font-size: 0.72rem; color: var(--text-muted); font-weight: 500;
}

.project-card-name {
    font-size: 1.1rem; font-weight: 600; color: var(--text-main); margin: 0 0 12px 0;
}

.project-card-stats {
    display: flex; gap: 16px; margin-top: auto;
}
.project-card-stat {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.78rem; color: var(--text-muted); font-weight: 500;
}
.project-card-stat svg { opacity: 0.6; }

.project-card-arrow {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); opacity: 0; transition: opacity 0.2s;
}
.project-card:hover .project-card-arrow { opacity: 1; }

/* ═══ Project Detail ═══ */
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; font-size: 0.85rem; }
.breadcrumb-link { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.breadcrumb-link:hover { color: var(--primary); }
.breadcrumb-sep { color: rgba(255,255,255,0.15); }
.breadcrumb-current { color: var(--text-main); font-weight: 500; }

.detail-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; gap: 16px;
}
.detail-header-left { display: flex; align-items: center; gap: 16px; }
.detail-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: rgba(108, 99, 255, 0.12); border: 1px solid rgba(108, 99, 255, 0.2);
    display: flex; align-items: center; justify-content: center; color: var(--primary);
    flex-shrink: 0;
}
.detail-title { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 0; }
.detail-meta { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.detail-meta-sep { opacity: 0.4; }

.detail-stats { display: flex; gap: 16px; margin-bottom: 28px; }
.detail-stat-card {
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px;
    padding: 16px 24px; text-align: center; backdrop-filter: blur(12px);
    min-width: 120px;
}
.detail-stat-number { font-size: 1.6rem; font-weight: 700; color: var(--primary); display: block; }
.detail-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; display: block; }

.repo-link {
    color: var(--primary); text-decoration: none; font-size: 0.85rem; word-break: break-all;
    transition: color 0.15s;
}
.repo-link:hover { color: #a78bfa; text-decoration: underline; }

@media (max-width: 768px) {
    .project-grid { grid-template-columns: 1fr; }
    .detail-stats { flex-direction: column; }
    .detail-header { flex-direction: column; align-items: flex-start; }
}

/* Mobile Top Bar (hidden on desktop) */
.mobile-topbar {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; z-index: 190;
    height: 56px; padding: 0 16px;
    background: rgba(10, 10, 20, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    align-items: center; justify-content: space-between;
}

.mobile-topbar-title {
    font-size: 0.9rem; font-weight: 600; color: var(--text-main);
}

.mobile-menu-btn {
    background: none; border: none; cursor: pointer;
    width: 32px; height: 32px; padding: 6px;
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
}

.mobile-menu-btn span {
    display: block; width: 100%; height: 2px;
    background: var(--text-main); border-radius: 1px;
    transition: all 0.2s;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 195;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0; transition: opacity 0.3s;
}

.sidebar-overlay.visible {
    display: block; opacity: 1;
}

/* Responsive: mobile sidebar behavior */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .mobile-topbar {
        display: flex;
    }

    .admin-main {
        margin-left: 0;
        padding: 72px 16px 32px;
    }

    body.has-sidebar {
        padding-top: 0;
    }
}
