:root {
    --bg-primary: #0f0f17;
    --bg-secondary: #1a1a2e;
    --bg-card: #16162a;
    --bg-card-hover: #1e1e3a;
    --border-color: #2a2a4a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --danger: #ef4444;
    --success: #22c55e;
    --info: #3b82f6;
    --radius: 12px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Header */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info-local .user-display-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.user-menu { display: flex; align-items: center; gap: 8px; }
.user-profile { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: white;
}
.user-display-name { font-size: 13px; color: var(--text-secondary); }

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

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

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

/* Main */
.home-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 36px;
}

.welcome-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

/* DC Cards Grid */
.dc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.dc-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dc-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 24px var(--accent-glow);
    transform: translateY(-3px);
}

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

.dc-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent);
}

.dc-permission {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.dc-permission.editor {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.dc-permission.viewer {
    color: var(--info);
    background: rgba(59, 130, 246, 0.1);
}

.dc-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.dc-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.dc-stats {
    display: flex;
    gap: 20px;
    padding: 14px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.dc-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dc-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.dc-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

.dc-card:hover .dc-card-footer svg {
    transform: translateX(3px);
    transition: transform 0.2s ease;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg { margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; line-height: 1.6; }

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.toast.error { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.toast.info { background: rgba(59, 130, 246, 0.15); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.3); }

/* Loading state */
.loading-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}
.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .dc-grid { grid-template-columns: 1fr; }
    .home-main { padding: 24px 16px; }
    .welcome-section h1 { font-size: 22px; }
}
