/* Claude Code Dashboard - Complete Styles */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #f97316;
    --accent-hover: #fb923c;
    --accent-secondary: #3b82f6;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --customer: #8b5cf6;
    --vendor: #06b6d4;
    --border: #334155;
}

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

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

.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.logo-icon { font-size: 1.75rem; }

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu { list-style: none; padding: 1rem 0.5rem; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin: 0.25rem 0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    position: relative;
}

.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active { background: linear-gradient(135deg, var(--accent), #ea580c); color: white; }
.nav-icon { font-size: 1.25rem; }

.nav-item .badge {
    position: absolute;
    right: 0.75rem;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-weight: 700;
}

.nav-item .badge.urgent {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.sidebar-actions {
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border);
}

.sidebar-btn {
    flex: 1;
    padding: 0.625rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

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

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

.account-info {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
}

.account-name { font-weight: 600; font-size: 0.875rem; }
.account-email { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Main Content */
.main-content { flex: 1; margin-left: 260px; padding: 1.5rem; }

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

.header h1 { font-size: 1.75rem; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 1rem; }

.btn {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--accent); }
.stat-card.highlight { background: linear-gradient(135deg, var(--accent), #ea580c); border: none; }
.stat-icon { font-size: 2rem; opacity: 0.9; }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-label { font-size: 0.875rem; color: var(--text-secondary); }
.stat-card.highlight .stat-label { color: rgba(255,255,255,0.8); }

/* Inbox Styles */
.inbox-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.inbox-stat {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    text-align: center;
    min-width: 100px;
}

.inbox-stat.customers { border-left: 4px solid var(--customer); }
.inbox-stat.vendors { border-left: 4px solid var(--vendor); }
.inbox-stat.urgent { border-left: 4px solid var(--danger); }

.inbox-stat-value { font-size: 1.5rem; font-weight: 700; }
.inbox-stat-label { font-size: 0.75rem; color: var(--text-muted); }

.inbox-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.inbox-filter {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.inbox-filter:hover { color: var(--text-primary); }
.inbox-filter.active { background: var(--accent); color: white; }

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.inbox-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: block;
}

.inbox-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.inbox-item.customer { border-left: 4px solid var(--customer); }
.inbox-item.vendor { border-left: 4px solid var(--vendor); }
.inbox-item.urgent { background: rgba(239, 68, 68, 0.1); }

.inbox-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.inbox-contact {
    font-weight: 600;
    flex: 1;
}

.type-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.customer { background: var(--customer); color: white; }
.type-badge.vendor { background: var(--vendor); color: white; }

.inbox-wait {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.inbox-wait.urgent {
    color: var(--danger);
    font-weight: 700;
}

.inbox-subject {
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.inbox-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inbox-tags {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.inbox-tag {
    font-size: 0.65rem;
    background: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--text-muted);
}

.inbox-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.inbox-error {
    text-align: center;
    padding: 2rem;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
}

.inbox-not-configured {
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px dashed var(--border);
}

.not-configured-icon { font-size: 3rem; margin-bottom: 1rem; }
.inbox-not-configured h3 { margin-bottom: 0.5rem; }
.inbox-not-configured p { color: var(--text-muted); margin-bottom: 1rem; }
.inbox-not-configured pre {
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    display: inline-block;
    font-size: 0.85rem;
}

.inbox-preview-section { margin-bottom: 1.5rem; }

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.chart-card.full { grid-column: 1 / -1; }
.chart-card h3 { margin-bottom: 1rem; font-size: 1rem; color: var(--text-secondary); }

/* Section */
.section { margin-bottom: 1.5rem; }
.section h2 { font-size: 1.25rem; margin-bottom: 1rem; color: var(--text-primary); }

/* Activity List */
.activity-list {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 100px 150px 1fr 80px;
    gap: 1rem;
    align-items: center;
}

.activity-item:last-child { border-bottom: none; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); }
.activity-project { font-weight: 500; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-command { font-family: 'Consolas', monospace; font-size: 0.875rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-session { font-size: 0.75rem; color: var(--text-muted); font-family: 'Consolas', monospace; }

/* Filters */
.filters { display: flex; gap: 1rem; margin-bottom: 1rem; }

.search-input, .select-input {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.search-input { flex: 1; }
.search-input:focus, .select-input:focus { outline: none; border-color: var(--accent); }

/* Project Stats Bar */
.project-stats-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.project-stat-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-stat-badge .count {
    background: var(--bg-primary);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-weight: 700;
}

.project-stat-badge.active { border-left: 3px solid var(--success); }
.project-stat-badge.recent { border-left: 3px solid var(--accent); }
.project-stat-badge.stale { border-left: 3px solid var(--text-muted); }
.project-stat-badge.git { border-left: 3px solid var(--accent-secondary); }
.project-stat-badge.production { border-left: 3px solid var(--customer); }

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
    position: relative;
}

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

.project-card.active { border-left: 4px solid var(--success); }
.project-card.recent { border-left: 4px solid var(--accent); }
.project-card.stale { border-left: 4px solid var(--text-muted); opacity: 0.7; }
.project-card.inactive { border-left: 4px solid var(--border); opacity: 0.5; }

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.project-title { display: flex; align-items: center; gap: 0.5rem; }

.project-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-btn {
    background: var(--bg-tertiary);
    border: none;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}

.project-btn:hover {
    opacity: 1;
    background: var(--accent);
}

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

.status-dot.active { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.recent { background: var(--accent); }
.status-dot.stale { background: var(--text-muted); }
.status-dot.inactive { background: var(--border); }

.project-name { font-weight: 600; font-size: 1.1rem; color: var(--text-primary); }
.project-cost { font-weight: 700; color: var(--accent); }
.project-path { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.75rem; word-break: break-all; }

/* Git Status */
.git-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.git-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-family: 'Consolas', monospace;
    background: var(--bg-tertiary);
}

.git-indicator.synced { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.git-indicator.ahead { background: rgba(59, 130, 246, 0.2); color: var(--accent-secondary); }
.git-indicator.behind { background: rgba(234, 179, 8, 0.2); color: var(--warning); }
.git-indicator.diverged { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.git-indicator.local-only { background: var(--bg-tertiary); color: var(--text-muted); }

.sync-icon { font-weight: 700; }

.owner-badge {
    background: linear-gradient(135deg, var(--accent), #ea580c);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.repo-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: 'Consolas', monospace;
}

.uncommitted-warning {
    font-size: 0.7rem;
    color: var(--warning);
    margin-bottom: 0.25rem;
}

.ahead-info {
    font-size: 0.7rem;
    color: var(--accent-secondary);
    margin-bottom: 0.25rem;
}

.sync-warning {
    font-size: 0.7rem;
    color: var(--danger);
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.25rem;
}

/* Production Badges */
.prod-badges {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.prod-badge {
    background: var(--customer);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Project Stats */
.project-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.project-stat {
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: 0.375rem;
    text-align: center;
}

.project-stat-value { font-weight: 600; font-size: 0.9rem; }
.project-stat-label { font-size: 0.65rem; color: var(--text-muted); }

.last-activity {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.project-mcps {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.mcp-tag {
    background: var(--accent-secondary);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
}

/* Commands Grid */
.commands-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.command-tag {
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.command-name { font-family: 'Consolas', monospace; color: var(--accent); }

.command-count {
    background: var(--accent);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Activity Table */
.activity-table-container {
    background: var(--bg-card);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    overflow: hidden;
    max-height: 500px;
    overflow-y: auto;
}

.activity-table { width: 100%; border-collapse: collapse; }

.activity-table th {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    position: sticky;
    top: 0;
}

.activity-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

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

/* Sessions */
.sessions-list { display: grid; gap: 1rem; }

.session-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.session-name { font-weight: 600; color: var(--accent); }

.session-location {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

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

.session-preview {
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Model Costs */
.model-costs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.model-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.model-name { font-weight: 600; margin-bottom: 0.75rem; color: var(--accent); }
.model-stats { display: grid; gap: 0.5rem; }
.model-stat-row { display: flex; justify-content: space-between; }
.model-stat-label { color: var(--text-muted); font-size: 0.875rem; }
.model-stat-value { font-weight: 600; }

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.skill-card {
    background: var(--bg-card);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
}

.skill-name { font-weight: 600; margin-bottom: 0.5rem; }
.skill-count { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.skill-last-used { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* MCP List */
.mcp-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.mcp-item {
    background: var(--bg-card);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mcp-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

/* GitHub List */
.github-list { display: grid; gap: 0.75rem; }

.github-item {
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.github-item.own-repo { border-left: 4px solid var(--accent); }
.github-repo { font-weight: 600; color: var(--accent-secondary); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.github-paths { font-size: 0.75rem; color: var(--text-muted); }

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

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

/* Loading */
.loading { text-align: center; padding: 2rem; color: var(--text-muted); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 80px; }
    .logo-text, .nav-item span:not(.nav-icon), .account-info, .sidebar-btn { display: none; }
    .nav-item { justify-content: center; }
    .main-content { margin-left: 80px; }
    .project-stats { grid-template-columns: repeat(2, 1fr); }
    .sidebar-actions { flex-direction: column; }
    .sidebar-btn { display: flex; justify-content: center; padding: 0.75rem; }
}

@media (max-width: 768px) {
    .charts-row { grid-template-columns: 1fr; }
    .activity-item { grid-template-columns: 1fr; gap: 0.25rem; }
    .projects-grid { grid-template-columns: 1fr; }
    .inbox-stats { flex-direction: column; }
}
