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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --critical: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    margin-bottom: 1.5rem;
}

.header-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-light);
}

.module-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    flex-wrap: wrap;
    position: sticky;
    top: 80px; /* Navbar height */
    z-index: 10;
    margin-top: 1rem;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--card-bg);
    cursor: pointer;
    transition: background 0.2s;
    border-right: 1px solid var(--border);
}

.toggle-btn:last-child {
    border-right: none;
}

.toggle-btn:hover {
    background: var(--bg);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

.search-filter {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 200px;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.critical {
    border-left-color: var(--critical);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.modules-container {
    display: grid;
    gap: 1.5rem;
    min-height: 1000px; /* Minimum height to show at least 9 modules (3 rows x 3 columns) */
    padding-right: 0.5rem;
    margin-top: 1rem;
}

.modules-container.card-view {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.modules-container.list-view {
    grid-template-columns: 1fr;
    min-height: 900px; /* Ensure at least 9 list items visible (9 x ~100px) */
}

/* Custom scrollbar styling */
.modules-container::-webkit-scrollbar {
    width: 8px;
}

.modules-container::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.modules-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.modules-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.module-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid var(--border);
    min-height: 180px; /* Ensure consistent card height for grid layout */
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.module-card.list-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    min-height: 80px; /* Consistent height for list items */
}

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

.module-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.module-name a {
    color: var(--primary);
    text-decoration: none;
}

.module-name a:hover {
    text-decoration: underline;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-indicator.healthy {
    background: var(--success);
}

.status-indicator.warning {
    background: var(--warning);
}

.status-indicator.critical {
    background: var(--critical);
}

.badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.needs-attention {
    background: #fef3c7;
    color: #92400e;
}

.badge.up-to-date {
    background: #d1fae5;
    color: #065f46;
}

.badge.out-of-sync {
    background: #fee2e2;
    color: #991b1b;
}

.badge.security {
    background: #fee2e2;
    color: #991b1b;
}

.module-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

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

.stat-item-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.stat-item-value {
    font-weight: 600;
    color: var(--text);
}

.module-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content.detail {
    max-width: 1200px;
}

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

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

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

.wizard-progress {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.active::after {
    background: var(--primary);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.progress-step.active .step-number {
    background: var(--primary);
    color: white;
}

.step-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.progress-step.active .step-label {
    color: var(--primary);
    font-weight: 500;
}

.wizard-body {
    padding: 2rem;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

.wizard-step h3 {
    margin-bottom: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.checklist {
    margin: 1.5rem 0;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg);
    border-radius: 8px;
}

.check-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.help-text {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.info-box {
    background: var(--bg);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.info-box p {
    margin: 0;
    color: var(--text);
}

.review-summary {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.detail-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-badge {
    background: var(--primary);
    color: white;
    border-radius: 12px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.tab-btn.active .tab-badge {
    background: var(--primary-dark);
}

.tab-content {
    display: none;
    padding: 2rem;
}

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

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.detail-section h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.detail-section p {
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.detail-section a {
    color: var(--primary);
    text-decoration: none;
}

.detail-section a:hover {
    text-decoration: underline;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.mini-stat {
    text-align: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.mini-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text);
}

.mini-stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.status-badge.healthy {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.critical {
    background: #fee2e2;
    color: #991b1b;
}

.platform-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border-radius: 12px;
    font-size: 0.875rem;
}

.issue-list,
.dependency-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.issue-item,
.dependency-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

.dep-name-link {
    flex: 1;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dep-name-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.dep-name-link.voxpupuli-module {
    cursor: pointer;
}

.vox-badge {
    background: var(--primary);
    color: white;
    border-radius: 4px;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dep-github-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.dep-github-link:hover {
    color: var(--primary);
}

.github-icon {
    font-size: 0.875rem;
}

.issue-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.issue-status.open {
    background: #dbeafe;
    color: #1e40af;
}

.issue-title {
    flex: 1;
    font-weight: 500;
}

.issue-meta {
    color: var(--text-light);
    font-size: 0.875rem;
}

.dep-name {
    flex: 1;
    font-weight: 500;
}

.dep-version {
    color: var(--text-light);
    font-family: monospace;
}

.trends-section {
    margin: 3rem 0;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

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

.chart-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.chart-card h4 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1rem;
}

.chart-card canvas {
    max-height: 300px;
}

.module-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

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

.module-chart-card h4 {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1rem;
}

.module-chart-card canvas {
    max-height: 250px;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-content {
        min-height: calc(100vh - 70px); /* Adjust for smaller navbar on mobile */
        padding: 1rem;
    }

    .modules-container {
        min-height: 600px; /* Smaller minimum height on mobile */
        max-height: 800px;
    }

    .module-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-filter {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-input {
        width: 100%;
    }

    .view-toggle {
        width: 100%;
        justify-content: center;
    }

    .modules-container.card-view {
        grid-template-columns: 1fr;
    }

    .wizard-progress {
        flex-direction: column;
        gap: 1rem;
    }

    .progress-step::after {
        display: none;
    }

    .detail-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .module-charts {
        grid-template-columns: 1fr;
    }
}

/* Alerts Page Styles */
.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.alert-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.alert-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    align-items: flex-start;
}

.alert-item.critical {
    border-left-color: var(--critical);
}

.alert-item.high {
    border-left-color: var(--warning);
}

.alert-item.medium {
    border-left-color: var(--secondary);
}

.alert-item.low {
    border-left-color: var(--success);
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.alert-module {
    font-weight: 600;
    color: var(--primary);
}

.alert-type {
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border-radius: 12px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.alert-time {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-left: auto;
}

.alert-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.alert-description {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.alert-action {
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text);
}

.alert-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.no-alerts {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* Reports Page Styles */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.report-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.report-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.report-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex: 1;
}

.report-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    justify-content: space-around;
}

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

.report-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text);
}

.report-stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.report-detail {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin-top: 2rem;
}

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

.report-detail-body {
    padding: 2rem;
}

.report-content h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.report-content h5 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.report-table {
    margin-top: 1.5rem;
    overflow-x: auto;
}

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

.report-table th,
.report-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.report-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text);
}

.backlog-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.backlog-item {
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.backlog-item.high {
    border-left-color: var(--warning);
}

.backlog-item.medium {
    border-left-color: var(--secondary);
}

.backlog-item h5 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.backlog-item p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.priority {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--card-bg);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.compliance-stats,
.dependency-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.compliance-item,
.stat-item {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
}

.security-alerts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.security-item {
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.security-item.critical {
    border-left-color: var(--critical);
}

.security-item.high {
    border-left-color: var(--warning);
}

.security-item h5 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.security-summary {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
}

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

    .alert-item {
        flex-direction: column;
    }

    .alert-actions {
        width: 100%;
        flex-direction: row;
    }
}

