/* ========================================
   ZAN DASHBOARD - CSS
   Dark theme with #00ff88 accent
   Mobile-first design with bottom nav
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-hover: #222222;
    --bg-card: linear-gradient(135deg, #151515 0%, #1a1a1a 100%);
    
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --accent-bg: rgba(0, 255, 136, 0.08);
    --accent-glow: 0 0 30px rgba(0, 255, 136, 0.2);
    
    --gradient-accent: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-orange: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --gradient-pink: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --success: #00ff88;
    
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --mobile-nav-height: 64px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;
    --border-radius-xs: 6px;
    
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 4px 20px rgba(0, 255, 136, 0.15);
    
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;
    
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Light theme overrides */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    --bg-card: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent: #00cc6a;
    --accent-dim: #00aa55;
    --accent-bg: rgba(0, 204, 106, 0.1);
    
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.12);
}

/* Theme transition */
.theme-transitioning,
.theme-transitioning * {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                color 0.3s ease !important;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: auto;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, var(--bg-primary) 50%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    padding: 48px 40px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.login-box h1 {
    font-size: 2.25rem;
    margin-bottom: 8px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box .subtitle {
    color: var(--text-secondary);
    margin-bottom: 36px;
    font-size: 1rem;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

input, textarea, select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 255, 136, 0.25);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.btn-accent {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 10px;
    min-width: 40px;
}

/* ========================================
   APP LAYOUT
   ======================================== */
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    position: relative;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 200;
    transition: transform var(--transition);
}

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

.sidebar-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
}

.sidebar-close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin-bottom: 4px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-bg);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(0, 255, 136, 0.2);
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
    min-width: 0;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    flex-shrink: 0;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all var(--transition);
}

.topbar-left {
    display: none;
}

.topbar-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.search-container {
    flex: 1;
    max-width: 480px;
}

.search-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: var(--border-radius);
    font-size: 0.9375rem;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hidden-mobile {
    display: inline;
}

/* View Container */
.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Bottom Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-area-bottom);
    z-index: 100;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
}

.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-icon {
    font-size: 1.25rem;
}

.mobile-nav-text {
    font-size: 0.6875rem;
    font-weight: 500;
}

/* ========================================
   DASHBOARD VIEW - ENHANCED
   ======================================== */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.view-title {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: 4px;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 28px;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.welcome-title span {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Stats Grid - Beautiful Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.purple::before { background: var(--gradient-purple); }
.stat-card.blue::before { background: var(--gradient-blue); }
.stat-card.orange::before { background: var(--gradient-orange); }
.stat-card.pink::before { background: var(--gradient-pink); }

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

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    background: var(--accent-bg);
}

.stat-card.purple .stat-icon-wrapper { background: rgba(168, 85, 247, 0.1); }
.stat-card.blue .stat-icon-wrapper { background: rgba(59, 130, 246, 0.1); }
.stat-card.orange .stat-icon-wrapper { background: rgba(249, 115, 22, 0.1); }
.stat-card.pink .stat-icon-wrapper { background: rgba(236, 72, 153, 0.1); }

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.stat-trend.down { color: var(--danger); }

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9375rem;
}

.quick-action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.quick-action-btn .icon {
    font-size: 1.125rem;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Section Cards */
.section-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

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

.section-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .icon {
    font-size: 1.125rem;
}

.section-content {
    padding: 16px;
}

.section-content.no-padding {
    padding: 0;
}

/* ========================================
   PROJECT CARDS - ENHANCED
   ======================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

.project-name {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
}

.project-status {
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.project-status.active {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.project-status.paused {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.project-status.completed {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.progress-container {
    margin-bottom: 12px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.75rem;
}

.progress-label {
    color: var(--text-secondary);
}

.progress-value {
    color: var(--accent);
    font-weight: 600;
}

.progress-bar {
    height: 5px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-accent);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.project-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========================================
   PROJECT DETAIL VIEW
   ======================================== */
.project-detail {
    max-width: 1200px;
}

.project-hero {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.project-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
}

.project-hero-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.project-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.project-hero-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 600px;
}

.project-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.project-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.project-stat {
    text-align: center;
}

.project-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.project-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Project Tabs */
.project-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.project-tab {
    flex: 1;
    min-width: 90px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    font-size: 0.875rem;
}

.project-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.project-tab.active {
    background: var(--accent-bg);
    color: var(--accent);
}

.project-tab-content {
    display: none;
}

.project-tab-content.active {
    display: block;
}

/* ========================================
   KANBAN BOARD (TASKS)
   ======================================== */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 500px;
    -webkit-overflow-scrolling: touch;
}

.kanban-column {
    min-width: 300px;
    max-width: 300px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

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

.kanban-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
}

.kanban-count {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kanban-tasks {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    min-height: 200px;
}

.kanban-tasks.drag-over {
    background: var(--accent-bg);
}

.task-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 14px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all var(--transition);
}

.task-card:hover {
    border-color: var(--accent);
    transform: translateX(2px);
}

.task-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.task-title {
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
    font-size: 0.9375rem;
}

.task-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.task-priority {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.task-priority.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.task-priority.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.task-priority.low {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* ========================================
   ACTIVITY TIMELINE - ENHANCED
   ======================================== */
.timeline {
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 50px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-bg);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-type {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.875rem;
}

.timeline-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.timeline-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Activity Feed compact */
.activity-feed {
    max-height: 380px;
    overflow-y: auto;
}

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

.activity-item:hover {
    background: var(--bg-tertiary);
}

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

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.activity-body {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   IDEAS & CONVERSATIONS
   ======================================== */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 18px;
    cursor: pointer;
    transition: all var(--transition);
}

.item-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

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

.item-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

.item-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.item-content {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.item-tags {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   CONTEXT / MEMORY VIEW
   ======================================== */
.context-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.context-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 20px;
}

.context-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-content {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    font-family: 'Monaco', 'Menlo', 'Fira Code', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    max-height: 260px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.visible,
.modal-overlay:not(.hidden) {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    bottom: calc(24px + var(--mobile-nav-height, 0px));
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 14px 18px;
    min-width: 280px;
    max-width: 380px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

.toast-icon { font-size: 1.125rem; }
.toast-content { flex: 1; }
.toast-message { color: var(--text-primary); font-weight: 500; font-size: 0.875rem; }

/* ========================================
   FILTER BAR
   ======================================== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar select {
    width: auto;
    min-width: 150px;
}

.filter-bar input {
    flex: 1;
    min-width: 180px;
}

/* ========================================
   QUICK ADD MODAL
   ======================================== */
.quick-add-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
}

.quick-add-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
}

.quick-add-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.quick-add-tab.active {
    color: var(--accent);
    background: var(--accent-bg);
}

/* ========================================
   UTILITIES
   ======================================== */
.hidden {
    display: none !important;
}

.error-message {
    color: var(--danger);
    padding: 12px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--border-radius-sm);
    margin-top: 16px;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9375rem;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    :root {
        --topbar-height: 56px;
    }
    
    /* Sidebar becomes a drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Hamburger visible */
    .hamburger-btn {
        display: flex;
    }
    
    .topbar-left {
        display: block;
        flex: 1;
    }
    
    .search-container {
        display: none;
    }
    
    /* Mobile bottom nav */
    .mobile-nav {
        display: flex;
    }
    
    /* Adjust view container for bottom nav */
    .view-container {
        padding: 20px 16px;
        padding-bottom: calc(20px + var(--mobile-nav-height));
    }
    
    /* Toast above mobile nav */
    .toast-container {
        bottom: calc(20px + var(--mobile-nav-height));
        left: 16px;
        right: 16px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    /* Stats grid - 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon-wrapper {
        width: 38px;
        height: 38px;
        font-size: 1.125rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Quick actions scroll */
    .quick-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        margin-bottom: 20px;
        gap: 10px;
    }
    
    .quick-action-btn {
        flex-shrink: 0;
        padding: 10px 14px;
        font-size: 0.875rem;
    }
    
    /* Dashboard grid stacked */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Projects single column */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    /* Project hero */
    .project-hero {
        padding: 20px;
    }
    
    .project-hero-title {
        font-size: 1.5rem;
    }
    
    .project-hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .project-stat-value {
        font-size: 1.25rem;
    }
    
    /* Kanban columns */
    .kanban-column {
        min-width: 280px;
        max-width: 280px;
    }
    
    /* Context grid */
    .context-grid {
        grid-template-columns: 1fr;
    }
    
    /* Filter bar stack */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-bar select,
    .filter-bar input {
        width: 100%;
        min-width: auto;
    }
    
    /* Modal */
    .modal-container {
        max-width: none;
        margin: 16px;
    }
    
    /* View header */
    .view-header {
        margin-bottom: 20px;
    }
    
    .view-title {
        font-size: 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .hidden-mobile {
        display: none;
    }
}

/* Small mobile (480px) */
@media (max-width: 480px) {
    .view-container {
        padding: 16px 14px;
        padding-bottom: calc(16px + var(--mobile-nav-height));
    }
    
    .section-header {
        padding: 14px 16px;
    }
    
    .section-content {
        padding: 14px;
    }
    
    .project-card {
        padding: 16px;
    }
    
    .kanban-column {
        min-width: 260px;
        max-width: 260px;
    }
    
    .project-tabs {
        padding: 4px;
    }
    
    .project-tab {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1025px) {
    .mobile-nav {
        display: none !important;
    }
    
    .hamburger-btn {
        display: none !important;
    }
    
    .topbar-left {
        display: none !important;
    }
    
    .sidebar-close-btn {
        display: none !important;
    }
    
    .toast-container {
        bottom: 24px;
    }
    
    .view-container {
        padding-bottom: 24px;
    }
}

/* Large desktop (1440px+) */
@media (min-width: 1440px) {
    .view-container {
        padding: 32px 40px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
}
