/* ── Fabric Hub Stylesheet ── */
/* Brand: Kindo — primary #6320e8, accent #F5A623 */

:root {
    --brand-primary: #6320e8;
    --brand-primary-hover: #5018c8;
    --brand-primary-light: rgba(99, 32, 232, 0.08);
    --brand-secondary: #3d3c44;
    --brand-accent: #F5A623;
    --brand-accent-light: rgba(245, 166, 35, 0.1);
    --brand-danger: #E8620A;
    --brand-success: #10B981;
    --brand-warning: #F59E0B;
    --brand-info: #3B82F6;

    /* Light theme (default) */
    --bg: #f8f8fc;
    --surface: #ffffff;
    --surface-hover: #f3f0ff;
    --text: #0d0b15;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --sidebar-bg: #0d0b15;
    --sidebar-text: #d1d5db;
    --sidebar-hover: rgba(99, 32, 232, 0.2);
    --sidebar-active: #6320e8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --topbar-height: 60px;
}

[data-theme="dark"] {
    --bg: #0d0b15;
    --surface: #1a1726;
    --surface-hover: #252132;
    --text: #f0eef5;
    --text-muted: #9ca3af;
    --text-light: #6b7280;
    --border: #2d2a3a;
    --border-light: #1f1c2e;
    --sidebar-bg: #070513;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
}

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

a:hover {
    text-decoration: underline;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.2s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: none;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    list-style: none;
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

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

.sidebar-nav li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav li a.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.user-role {
    color: var(--sidebar-text);
    font-size: 11px;
}

.sidebar-logout {
    color: var(--sidebar-text);
    padding: 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.sidebar-logout:hover {
    color: #fff;
    background: rgba(232, 98, 10, 0.2);
}

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Bar ── */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle,
.help-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.theme-toggle:hover,
.help-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--brand-primary);
}

[data-theme="light"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }

/* ── Page Content ── */
.page-content {
    padding: 28px;
    flex: 1;
}

/* ── Flash Messages ── */
.flash-container {
    padding: 16px 28px 0;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 14px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.flash-danger { background: rgba(232, 98, 10, 0.1); color: #E8620A; border: 1px solid rgba(232, 98, 10, 0.2); }
.flash-warning { background: rgba(245, 158, 11, 0.1); color: #D97706; border: 1px solid rgba(245, 158, 11, 0.2); }
.flash-info { background: rgba(59, 130, 246, 0.1); color: #2563EB; border: 1px solid rgba(59, 130, 246, 0.2); }

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 4px;
}

.flash-close:hover { opacity: 1; }

/* ── Cards & Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

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

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Sections ── */
.section {
    margin-bottom: 28px;
}

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

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
}

/* ── Action Cards ── */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.action-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none;
    color: var(--brand-primary);
}

/* ── Info Box ── */
.info-box {
    background: var(--brand-primary-light);
    border: 1px solid rgba(99, 32, 232, 0.15);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Auth Pages — Kindo Branded ── */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    background: #0F1624;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(99, 32, 232, 0.15), transparent),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(99, 32, 232, 0.08), transparent),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(245, 166, 35, 0.05), transparent);
    flex-direction: column;
    gap: 16px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.auth-logo-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-kindo-icon {
    filter: brightness(1.1);
}

.auth-kindo-wordmark {
    filter: brightness(1.1);
}

.auth-logo-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.auth-logo h1 {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.auth-card h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #f0eef5;
}

.auth-card .form-group label {
    color: rgba(255, 255, 255, 0.7);
}

.auth-card .form-group input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f0eef5;
}

.auth-card .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-card .form-group input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.auth-card .btn-primary {
    background: var(--brand-primary);
    font-weight: 600;
    padding: 12px 20px;
    font-size: 15px;
    letter-spacing: 0.01em;
}

.auth-card .btn-primary:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 4px 12px rgba(99, 32, 232, 0.35);
}

.auth-link {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.auth-link a {
    color: var(--brand-primary);
    font-weight: 500;
}

.auth-link a:hover {
    color: #8b5cf6;
}

.auth-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
}

.auth-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-footer-link:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

/* Auth page flash messages on dark background */
.auth-container .flash-container {
    width: 100%;
    max-width: 440px;
}

.auth-container .flash {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-container .flash-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.25);
}

.auth-container .flash-danger {
    background: rgba(232, 98, 10, 0.15);
    border-color: rgba(232, 98, 10, 0.25);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 32, 232, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
    color: #fff;
    text-decoration: none;
}

.btn-full {
    width: 100%;
}

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

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

/* ── Help Drawer ── */
.help-drawer {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.25s ease;
    box-shadow: var(--shadow-lg);
}

.help-drawer.open {
    right: 0;
}

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

.help-drawer-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.help-drawer-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px 8px;
}

.help-drawer-close:hover { color: var(--text); }

.help-drawer-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    line-height: 1.7;
}

.help-drawer-body h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.help-drawer-body ul {
    padding-left: 18px;
    margin: 8px 0;
}

.help-drawer-body li {
    margin-bottom: 6px;
}

.help-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 150;
}

.help-overlay.open {
    display: block;
}

/* ── Error Page ── */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-code {
    font-size: 72px;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1;
    margin-bottom: 16px;
}

.error-page h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 15px;
}

/* ── Getting Started ── */
.getting-started .intro-text {
    margin-bottom: 24px;
    font-size: 15px;
    color: var(--text-muted);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.step-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.step-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.step-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.step-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-status.upcoming {
    background: var(--brand-accent-light);
    color: var(--brand-accent);
}

.step-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--brand-success);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .page-content {
        padding: 16px;
    }

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .auth-card {
        padding: 28px 24px;
    }

    .auth-logo {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .auth-logo-divider {
        width: 60px;
        height: 1px;
    }

    .help-drawer {
        width: 100%;
        right: -100%;
    }
}

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

/* ── Sprint 2: Admin Settings & Project Catalog ── */

/* ── Settings Layout ── */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.settings-card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    gap: 6px;
}

/* ── Connection Status Badges ── */
.connection-status {
    display: flex;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-running {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-badge.status-stopped {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.status-badge.status-disconnected {
    background: rgba(232, 98, 10, 0.1);
    color: #E8620A;
}

.status-badge.status-pending, .status-badge.status-building {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.status-badge.status-unknown {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
}

.status-badge.status-pinned {
    background: rgba(99, 32, 232, 0.1);
    color: #6320e8;
    gap: 4px;
}

/* ── Project Checklist ── */
.project-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
}

.project-check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s ease;
}

.project-check-item:hover {
    background: var(--surface-hover);
}

.project-check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--brand-primary);
}

.project-check-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.project-check-name {
    font-size: 14px;
    font-weight: 500;
}

.project-check-folder {
    font-size: 11px;
    color: var(--brand-primary);
    font-weight: 500;
}

.project-check-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Project Catalog ── */
.catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.catalog-summary {
    font-size: 15px;
    color: var(--text-muted);
}

.catalog-section {
    margin-bottom: 28px;
}

.catalog-folder-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.project-card-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.project-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 12px;
}

.project-card-desc-empty {
    font-style: italic;
    color: var(--text-light);
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.project-card-id {
    font-size: 11px;
    color: var(--text-light);
    font-family: monospace;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state svg {
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ── Info Box Warning ── */
.info-box-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

/* ── Sidebar Section Label ── */
.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
    padding: 16px 14px 6px;
    list-style: none;
}

/* ── Sprint 3: Project Detail & Activity ── */

/* ── Project Detail Page ── */
.project-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.detail-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.detail-header {
    margin-bottom: 16px;
}

.detail-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.detail-title-row h2 {
    font-size: 22px;
    font-weight: 700;
}

.detail-folder {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--brand-primary);
    font-weight: 500;
}

.detail-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.detail-meta-item {
    font-size: 13px;
    color: var(--text-muted);
}

.detail-meta-item code {
    font-size: 12px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-info-banner {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
}

.detail-info-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.detail-info-danger {
    background: rgba(232, 98, 10, 0.1);
    color: #E8620A;
    border: 1px solid rgba(232, 98, 10, 0.2);
}

/* ── Activity Log ── */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-list-compact .activity-item {
    padding: 10px 16px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.activity-icon-start {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.activity-icon-stop {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.activity-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.activity-text {
    font-size: 13px;
    color: var(--text);
}

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

.activity-detail {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.empty-text {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Project card link styling ── */
.project-card-name a {
    color: var(--text);
    text-decoration: none;
}

.project-card-name a:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

/* ── Sprint 4: Share Links ── */

/* ── Share Dialog ── */
.share-info {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.share-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ttl-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ttl-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ttl-btn:hover {
    border-color: var(--brand-primary);
    background: var(--surface-hover);
}

.ttl-btn-active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

.ttl-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ttl-custom label {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.ttl-custom input {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
}

.ttl-max-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.ttl-max-warning {
    color: var(--brand-danger);
    font-weight: 600;
}

.ttl-near-warning {
    color: var(--brand-accent);
    font-weight: 500;
}

.share-form-actions {
    display: flex;
    gap: 8px;
}

/* ── Share Result ── */
.share-result {
    margin-top: 16px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius);
}

.share-url-box {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.share-url-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    background: var(--surface);
    color: var(--text);
}

.share-expires {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Share Links List ── */
.share-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    flex-wrap: wrap;
}

.share-link-item.share-expired,
.share-link-item.share-revoked {
    opacity: 0.6;
}

.share-link-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.share-link-ttl {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.share-link-by {
    font-size: 12px;
    color: var(--text-light);
}

.share-link-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.share-link-url {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-link-expires {
    font-size: 11px;
    color: var(--text-light);
}

.share-revoke-btn {
    flex-shrink: 0;
}

.detail-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.detail-card-header-row h3 {
    margin-bottom: 0;
}

/* ── Activity icon for share action ── */
.activity-icon-share {
    background: rgba(99, 32, 232, 0.1);
    color: #6320e8;
}

.activity-icon-revoke_share {
    background: rgba(232, 98, 10, 0.1);
    color: #E8620A;
}

/* ── Sprint 5: Admin Panel ── */

/* ── Admin Tables ── */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--surface-hover);
}

.admin-table .row-disabled td {
    opacity: 0.5;
}

.nowrap { white-space: nowrap; }

.details-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ── Role Badges ── */
.role-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.role-admin {
    background: rgba(99, 32, 232, 0.1);
    color: #6320e8;
}

.role-user {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* ── Action Badges ── */
.action-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.action-start { background: rgba(16, 185, 129, 0.1); color: #059669; }
.action-stop { background: rgba(107, 114, 128, 0.1); color: #6b7280; }
.action-share { background: rgba(99, 32, 232, 0.1); color: #6320e8; }
.action-revoke_share { background: rgba(232, 98, 10, 0.1); color: #E8620A; }

/* ── Inline Forms ── */
.inline-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form .form-group {
    margin-bottom: 0;
}

.inline-edit-form {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.role-select {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
}

/* ── Extra Button Sizes ── */
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-danger {
    background: var(--brand-danger);
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #c85008;
    color: #fff;
    text-decoration: none;
}

/* ── Sprint 6: Polish, Notifications & Responsive ── */

/* ── Notification Banners ── */
.expiry-warnings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    animation: slideDown 0.2s ease;
}

.notification-critical {
    background: rgba(232, 98, 10, 0.08);
    border: 1px solid rgba(232, 98, 10, 0.2);
    color: #E8620A;
}

.notification-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #D97706;
}

.notification-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.notification-content {
    flex: 1;
    line-height: 1.5;
}

.notification-meta {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-top: 2px;
}

.session-timeout-banner {
    position: sticky;
    top: 0;
    z-index: 60;
}

/* ── Keyboard Shortcuts ── */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
}

kbd {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-family: var(--font);
    font-weight: 600;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--border);
    min-width: 24px;
    text-align: center;
}

/* ── API Reference ── */
.api-ref-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.api-ref-table-wrap code {
    font-size: 12px;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 3px;
}

/* ── Getting Started Polish ── */
.getting-started .intro-text h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

/* ── Responsive refinements ── */
@media (max-width: 768px) {
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }

    .notification-banner {
        font-size: 12px;
        padding: 10px 12px;
    }

    .ttl-presets {
        flex-wrap: wrap;
    }

    .ttl-custom {
        flex-direction: column;
        align-items: flex-start;
    }

    .share-url-box {
        flex-direction: column;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-table {
        font-size: 12px;
    }

    .admin-table th, .admin-table td {
        padding: 8px 10px;
    }

    .actions-cell {
        flex-direction: column;
        gap: 4px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .btn {
        width: 100%;
    }
}

/* ── Sprint 7: Groups & Scoped Visibility ── */

.group-card {
    margin-bottom: 16px;
}

.group-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
}

.group-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.group-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.member-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.member-check-item:hover {
    background: var(--surface-hover);
}

.member-check-item input[type="checkbox"] {
    accent-color: var(--brand-primary);
}

/* ── Scoped Access Tags ── */
.project-access-item {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

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

.project-scope-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.scope-label {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

.scope-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
}

.scope-user {
    background: rgba(99, 32, 232, 0.08);
    color: var(--brand-primary);
}

.scope-group {
    background: rgba(245, 166, 35, 0.08);
    color: var(--brand-accent);
}

/* ── Sprint 11: API Keys ── */
.api-key-form .form-row {
    display: flex; gap: 12px; align-items: flex-start;
}
.api-keys-list {
    display: flex; flex-direction: column; gap: 8px; margin-top: 12px;
}
.api-key-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-radius: 8px;
    background: var(--bg-secondary, #f9f9f9); border: 1px solid var(--border-color, #e0e0e0);
}
.api-key-revoked {
    opacity: 0.6;
}
.api-key-info {
    display: flex; flex-direction: column; gap: 2px;
}
.api-key-label {
    font-weight: 600; font-size: 14px;
}
.api-key-prefix {
    font-family: monospace; font-size: 12px; color: var(--text-muted, #888);
    background: var(--bg-tertiary, #f0f0f0); padding: 2px 6px; border-radius: 4px;
    display: inline-block; margin-top: 2px;
}
.api-key-meta {
    font-size: 11px; color: var(--text-muted, #888);
}
.api-key-actions {
    display: flex; align-items: center; gap: 8px;
}
.integration-instructions summary {
    color: var(--brand-primary, #6320e8);
}

/* ── Sprint 11: Media Files ── */
.media-layout {
    display: flex; flex-direction: column; gap: 20px;
}
.media-files-list {
    display: flex; flex-direction: column; gap: 8px;
}
.media-file-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 8px;
    background: var(--bg-secondary, #f9f9f9); border: 1px solid var(--border-color, #e0e0e0);
}
.media-file-icon {
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.media-type-document { background: rgba(99, 32, 232, 0.1); color: #6320e8; }
.media-type-image { background: rgba(245, 166, 35, 0.1); color: #F5A623; }
.media-type-video { background: rgba(232, 98, 10, 0.1); color: #E8620A; }
.media-type-other { background: rgba(61, 60, 68, 0.1); color: #3d3c44; }
.media-file-info {
    flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.media-file-name {
    font-weight: 600; font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-file-desc {
    font-size: 13px; color: var(--text-muted, #888);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-file-meta {
    font-size: 11px; color: var(--text-muted, #888);
}
.media-file-actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.media-files-compact .media-file-item {
    padding: 8px 12px;
}
.media-files-compact .media-file-icon {
    width: 32px; height: 32px;
}
.btn-danger-text { color: var(--brand-danger, #E8620A) !important; }
.btn-danger-text:hover { background: rgba(232, 98, 10, 0.1) !important; }

/* ── Sprint 11: Source Badge ── */
.source-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.source-studio {
    background: rgba(99, 32, 232, 0.1); color: #6320e8;
}

/* ── API Key Reveal (copy-to-clipboard) ── */
.api-key-reveal {
    background: var(--brand-bg, #c1a6f6);
    border: 2px solid var(--brand-primary, #6320e8);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

[data-theme="dark"] .api-key-reveal {
    background: rgba(99, 32, 232, 0.15);
    border-color: var(--brand-primary, #6320e8);
}

.api-key-reveal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--brand-text, #0d0b15);
}

.api-key-reveal-header svg {
    color: var(--brand-primary, #6320e8);
    flex-shrink: 0;
}

.api-key-reveal-warning {
    font-size: 13px;
    color: var(--brand-danger, #E8620A);
    font-weight: 500;
    margin: 0 0 12px 0;
}

.api-key-reveal-value {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary, #f8f8f8);
    border: 1px solid var(--brand-border, #D9D9D6);
    border-radius: 6px;
    padding: 10px 12px;
}

[data-theme="dark"] .api-key-reveal-value {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.api-key-reveal-value code {
    flex: 1;
    font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--brand-text, #0d0b15);
    user-select: all;
    -webkit-user-select: all;
    background: none;
    padding: 0;
}

[data-theme="dark"] .api-key-reveal-value code {
    color: #e0e0e0;
}

.copy-key-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 80px;
    justify-content: center;
}

.copy-key-btn .copy-label {
    font-size: 13px;
}
