/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme Colors — Fusic Brand */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --bg-tertiary: #eef1f5;
    --text-primary: #0f1419;
    --text-secondary: #536471;
    --text-muted: #8899a6;
    --border-color: #eff3f4;
    --accent-primary: #004098;
    --accent-secondary: #0058d4;
    --accent-light: rgba(0, 64, 152, 0.06);
    --success: #00ba7c;
    --warning: #f59e0b;
    --error: #E6002D;
    --shadow: 0 1px 3px rgba(0, 10, 19, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 10, 19, 0.08);
    --card-radius: 10px;
}

.dark-theme {
    --bg-primary: #06111d;
    --bg-secondary: #0c1d30;
    --bg-tertiary: #132b44;
    --text-primary: #e7edf4;
    --text-secondary: #8899a6;
    --text-muted: #536471;
    --border-color: rgba(255, 255, 255, 0.06);
    --accent-primary: #4d9fff;
    --accent-secondary: #79b8ff;
    --accent-light: rgba(77, 159, 255, 0.08);
    --success: #3dd68c;
    --warning: #fbbf24;
    --error: #ff4d6a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.25);
    --card-radius: 10px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: color 0.15s;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.15s, border-color 0.15s;
    line-height: 1;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-center {
    flex: 1;
    max-width: 360px;
    margin: 0 24px;
}

.repository-filter-form {
    width: 100%;
}

.repo-dropdown {
    position: relative;
    width: 100%;
}

.repo-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.repo-dropdown-toggle:hover {
    border-color: var(--text-muted);
}

.repo-dropdown.open .repo-dropdown-toggle {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 64, 152, 0.12);
}

.repo-dropdown-toggle span {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-dropdown-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.repo-dropdown.open .repo-dropdown-arrow {
    transform: rotate(180deg);
}

.repo-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    overflow: hidden;
}

.repo-dropdown.open .repo-dropdown-menu {
    display: block;
}

.repo-dropdown-search {
    position: relative;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.repo-dropdown-search i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
}

.repo-dropdown-search input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
}

.repo-dropdown-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.repo-dropdown-list {
    list-style: none;
    padding: 4px 0;
    margin: 0;
    max-height: 280px;
    overflow-y: auto;
}

.repo-dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.repo-dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

.repo-dropdown-item.selected {
    color: var(--accent-primary);
    font-weight: 500;
}

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

.user-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 0.75rem;
}

.logout-form {
    display: inline;
    margin-left: 0.5rem;
}

.logout-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    color: #e53e3e;
    border-color: #e53e3e;
    background: rgba(229, 62, 62, 0.06);
}

.notification-bell {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

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

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--error);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile:hover {
    background-color: var(--bg-tertiary);
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-profile span {
    font-size: 14px;
    font-weight: 500;
}

.user-profile i {
    color: var(--text-muted);
    font-size: 12px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    width: 240px;
    height: calc(100vh - 56px);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 16px 0;
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.2s ease;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0 12px;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover {
    background-color: var(--accent-light);
    color: var(--text-primary);
}

.nav-item.active .nav-link {
    background-color: var(--accent-light);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.sidebar-footer {
    position: absolute;
    bottom: 16px;
    left: 12px;
    right: 12px;
}

.upgrade-card {
    background-color: var(--accent-light);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    color: var(--accent-primary);
    border: 1px solid var(--border-color);
}

.upgrade-card i {
    font-size: 24px;
    margin-bottom: 8px;
}

.upgrade-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.upgrade-card p {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.upgrade-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    margin-left: 240px;
    margin-top: 56px;
    padding: 24px 28px;
    min-height: calc(100vh - 56px);
}

/* Stats Overview */
.stats-overview {
    margin-bottom: 24px;
}

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

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.15s;
}

.stat-card:hover {
    border-color: var(--text-muted);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.stat-icon.commits {
    background-color: rgba(0, 64, 152, 0.1);
    color: #004098;
}

.stat-icon.pull-requests {
    background-color: rgba(0, 186, 124, 0.1);
    color: var(--success);
}

.stat-icon.issues {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.contributors {
    background-color: rgba(230, 0, 45, 0.1);
    color: #E6002D;
}

.stat-icon.ai-productivity {
    background-color: rgba(0, 64, 152, 0.1);
    color: #004098;
}

.stat-icon.code-velocity {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.critical {
    background-color: rgba(230, 0, 45, 0.1);
    color: #E6002D;
}

.stat-icon.high {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.merge-time {
    background-color: rgba(0, 186, 124, 0.1);
    color: var(--success);
}

.stat-icon.quality-score {
    background-color: rgba(0, 64, 152, 0.1);
    color: #004098;
}

.dark-theme .stat-icon.commits,
.dark-theme .stat-icon.ai-productivity,
.dark-theme .stat-icon.quality-score {
    background-color: rgba(77, 159, 255, 0.12);
    color: var(--accent-primary);
}

.dark-theme .stat-icon.pull-requests,
.dark-theme .stat-icon.merge-time {
    background-color: rgba(61, 214, 140, 0.12);
    color: var(--success);
}

.dark-theme .stat-icon.critical,
.dark-theme .stat-icon.contributors {
    background-color: rgba(255, 77, 106, 0.12);
    color: var(--error);
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.stat-change.positive {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.stat-change.negative {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Charts Section */
.charts-section {
    margin-bottom: 24px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.charts-grid:last-child {
    margin-bottom: 0;
}

.chart-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 20px;
}

.chart-card.large {
    grid-column: span 1;
}

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

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.chart-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin: -12px 0 16px;
    line-height: 1.5;
}

.time-filter, .filter-btn {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.filter-btn {
    margin-left: 6px;
}

.filter-btn.active {
    background-color: var(--accent-light);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Recent Activity */
.recent-activity {
    margin-bottom: 24px;
}

.activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.activity-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 20px;
}

.view-all {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.activity-list, .contributors-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item, .contributor-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.15s;
}

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

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.activity-icon.pr-merged {
    background-color: rgba(0, 186, 124, 0.1);
    color: var(--success);
}

.activity-icon.pr-open {
    background-color: rgba(77, 159, 255, 0.1);
    color: var(--accent-primary);
}

.activity-icon.pr-draft {
    background-color: rgba(83, 100, 113, 0.1);
    color: var(--text-muted);
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.activity-content p {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.activity-status.merged {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.activity-status.open {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--accent-primary);
}

.activity-status.draft {
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

.contributor-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.contributor-info {
    flex: 1;
}

.contributor-info h4 {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.contributor-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.contributor-stats {
    display: flex;
    gap: 8px;
}

.commit-count, .addition-count {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.commit-count {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.addition-count {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Repository Performance */
.repo-performance {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 20px;
}

.repo-table {
    overflow-x: auto;
}

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

.repo-table th,
.repo-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.repo-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.repo-table td {
    font-size: 14px;
}

.repo-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.repo-info i {
    color: var(--text-muted);
}

.language-tag {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.language-tag.javascript {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
}

.language-tag.python {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.language-tag.swift {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.status-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.status-badge.active {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status-badge.maintenance {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Performance Metrics Styles */
.performance-metrics {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.metric-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.metric-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.metric-comparison {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-bar {
    display: flex;
    align-items: center;
    position: relative;
    height: 32px;
    padding: 0 12px;
}

.metric-value {
    font-size: 12px;
    font-weight: 600;
    min-width: 120px;
    z-index: 2;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.metric-bar.ai .metric-value {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.metric-bar.human .metric-value {
    color: var(--text-primary);
    font-weight: 600;
}

.metric-bar .bar {
    height: 32px;
    border-radius: 16px;
    position: absolute;
    left: 0;
    top: 0;
    transition: width 0.8s ease;
}

.metric-bar.ai .bar {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.8;
}

.metric-bar.human .bar {
    background: linear-gradient(90deg, var(--text-muted), var(--text-secondary));
    opacity: 0.6;
}

/* Department List Styles */
.department-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.department-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 6px;
    transition: background-color 0.15s;
}

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

.department-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.department-icon.frontend {
    background-color: rgba(97, 218, 251, 0.1);
    color: #61dafb;
}

.department-icon.backend {
    background-color: rgba(104, 211, 145, 0.1);
    color: #68d391;
}

.department-icon.mobile {
    background-color: rgba(251, 182, 206, 0.1);
    color: #ed64a6;
}

.department-info {
    flex: 1;
}

.department-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.department-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.progress-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-primary) 0deg, var(--accent-primary) calc(var(--progress, 75) * 3.6deg), var(--bg-tertiary) calc(var(--progress, 75) * 3.6deg));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-ring::before {
    content: '';
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    position: absolute;
}

.progress-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 2;
}

/* AI Impact Analysis */
.ai-impact-analysis {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.impact-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.15s;
}

.impact-card:hover {
    border-color: var(--text-muted);
}

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

.impact-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.impact-trend {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.impact-trend.positive {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.impact-trend.negative {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.impact-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

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

.detail-item .value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .activity-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .header-center {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .user-profile span {
        display: none;
    }
    
    .impact-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .metric-bar .bar {
        position: relative;
        width: 100%;
    }
    
    .department-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

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

.stat-card,
.chart-card,
.activity-card {
    animation: fadeIn 0.3s ease-out;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

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

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

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.modal-body {
    margin-bottom: 20px;
}

.modal-body label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-body input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-body input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 64, 152, 0.15);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.btn-save {
    background-color: var(--accent-primary);
    color: white;
    border: none;
}

.btn-save:hover {
    background-color: var(--accent-secondary);
}

.btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.editable-name {
    cursor: pointer;
    transition: color 0.2s ease;
}

.editable-name:hover {
    color: var(--accent-primary);
}

/* Organization Overview */
.organization-section {
    margin-bottom: 24px;
}

.organization-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    align-items: start;
}

.organization-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.organization-alert {
    background-color: rgba(230, 0, 45, 0.08);
    color: var(--error);
    border: 1px solid rgba(230, 0, 45, 0.2);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
}

.org-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.org-metric {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 14px;
}

.org-metric-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.org-metric-value {
    font-size: 18px;
    font-weight: 600;
}

.language-table table {
    min-width: 100%;
}

.language-table td:first-child,
.language-table th:first-child {
    width: 40%;
}

.organization-section .card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.last-updated {
    font-weight: 500;
}

.repo-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.repo-link:hover {
    text-decoration: underline;
}

.org-activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.org-activity-meta i {
    margin-right: 4px;
    color: var(--accent-secondary);
}

.activity-icon.org-recent {
    background-color: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
}

.activity-icon.org-new {
    background-color: rgba(0, 64, 152, 0.1);
    color: #004098;
}

.empty-state {
    font-size: 14px;
    color: var(--text-muted);
    padding: 12px 0;
}

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

    .organization-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .organization-sidebar .chart-card {
        flex: 1 1 320px;
    }
}

@media (max-width: 768px) {
    .org-metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .organization-sidebar {
        flex-direction: column;
    }
}

/* AI Instruction Files */
.ai-instruction-files-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-file-item {
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    padding: 14px;
}

.ai-file-item:hover {
    background-color: var(--bg-primary);
}

.ai-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-file-info {
    display: flex;
    align-items: center;
}

.ai-file-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.ai-file-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ai-file-count {
    color: var(--text-primary);
    font-weight: 600;
}

.ai-file-ratio {
    color: var(--text-muted);
    font-size: 13px;
}

.ai-file-progress {
    width: 100%;
    height: 8px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.ai-file-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Multi-select Repository Dropdown */
.repo-dropdown-item .checkbox-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    position: relative;
    flex-shrink: 0;
}

.repo-dropdown-item.selected .checkbox-indicator {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.repo-dropdown-item.selected .checkbox-indicator::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.repo-dropdown-item-all .checkbox-indicator {
    border-radius: 50%;
}

.repo-dropdown-item-all.selected .checkbox-indicator::after {
    left: 3px;
    top: 3px;
    width: 6px;
    height: 6px;
    border: none;
    border-radius: 50%;
    background-color: white;
    transform: none;
}

.repo-dropdown-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.repo-dropdown-footer {
    padding: 8px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.repo-dropdown-apply {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.repo-dropdown-apply:hover {
    background-color: var(--accent-secondary);
}
