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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}

.header {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.header p {
    color: #bfdbfe;
    font-size: 18px;
}

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

.stat-card {
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.stat-card.epics { background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%); }
.stat-card.features { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); }
.stat-card.pbis { background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); }
.stat-card.completion { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.stat-card.total { background: linear-gradient(135deg, #64748b 0%, #475569 100%); }

.stat-card h3 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 42px;
    font-weight: bold;
}

.section {
    background: #1e293b;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

th {
    background: #334155;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #475569;
}

td {
    padding: 16px;
    border-bottom: 1px solid #334155;
}

tr:hover {
    background: #334155;
}

tr.epic-row {
    cursor: pointer;
}

tr.epic-row:hover {
    background: #3f4e63;
}

tr.epic-row.completed {
    background: rgba(16, 185, 129, 0.05);
}

tr.epic-row.completed:hover {
    background: rgba(16, 185, 129, 0.1);
}

tr.feature-row-container {
    background: #1e293b;
}

tr.feature-row-container td {
    padding: 0 !important;
}

.features-container {
    padding: 20px 40px;
    display: none;
}

.features-container.visible {
    display: block;
}

.feature-row {
    background: #2d3b4e;
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #475569;
    transition: all 0.2s;
}

.feature-row:hover {
    background: #364558;
    border-color: #64748b;
}

.feature-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feature-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.pbis-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #475569;
    display: none;
}

.pbis-container.visible {
    display: block;
}

.expand-icon {
    display: inline-block;
    transition: transform 0.3s;
    font-size: 14px;
    color: #94a3b8;
    width: 20px;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.milestone-badge {
    background: #2563eb;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge.completed {
    background: #10b981;
}

.status-badge.in-progress {
    background: #f59e0b;
}

.progress-bar {
    background: #475569;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-fill.completed {
    background: #10b981;
}

.progress-fill.in-progress {
    background: #3b82f6;
}

.percentage {
    font-size: 24px;
    font-weight: bold;
}

.percentage.completed {
    color: #10b981;
}

.percentage.in-progress {
    color: #3b82f6;
}

.epic-item {
    background: #334155;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 2px solid #475569;
}

.epic-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.epic-header:hover {
    background: #3f4e63;
}

.epic-header.completed {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
}

.epic-icon {
    font-size: 24px;
}

.epic-info {
    flex: 1;
}

.epic-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.epic-meta {
    font-size: 14px;
    color: #94a3b8;
}

.epic-stats {
    text-align: right;
}

.feature-list {
    padding: 20px;
    background: #1e293b;
    display: none;
}

.feature-list.visible {
    display: block;
}

.feature-item {
    background: #2d3b4e;
    padding: 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
}

.feature-item:hover {
    background: #364558;
}

.pbi-list {
    padding: 15px;
    background: #1e293b;
    margin-top: 10px;
    border-radius: 6px;
    display: none;
}

.pbi-list.visible {
    display: block;
}

.pbi-item {
    padding: 12px;
    margin-bottom: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.pbi-item.pending {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
}

.pbi-item.completed {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
}

.pbi-icon {
    font-size: 16px;
}

.pbi-id {
    color: #94a3b8;
    font-family: monospace;
}

.copy-icon {
    cursor: pointer;
    font-size: 12px;
    margin-left: 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
    user-select: none;
}

.copy-icon:hover {
    opacity: 1;
}

.copy-icon.copied {
    color: #10b981;
}

.id-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pbi-status {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.pbi-status.pending {
    background: rgba(251, 146, 60, 0.3);
    color: #fbbf24;
}

.pbi-status.completed {
    background: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.chevron {
    transition: transform 0.3s;
}

.chevron.expanded {
    transform: rotate(90deg);
}

button {
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

textarea {
    transition: border-color 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.8) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Health indicator tooltips */
.health-indicator {
    position: relative;
    cursor: help;
    transition: all 0.2s;
}

.health-indicator:hover {
    transform: scale(1.05);
}

.health-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.health-indicator:hover .health-tooltip {
    opacity: 1;
    visibility: visible;
}

.health-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #1e293b;
}

.health-tooltip-title {
    font-size: 13px;
    font-weight: 600;
    color: #bfdbfe;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #334155;
}

.health-tooltip-list {
    max-height: 300px;
    overflow-y: auto;
}

.health-tooltip-item {
    padding: 6px 0;
    font-size: 12px;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.health-tooltip-item .epic-id {
    color: #fbbf24;
    font-weight: 600;
    min-width: 60px;
}

.health-tooltip-item .epic-name {
    flex: 1;
}

.health-tooltip-item .epic-percentage {
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

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

    th, td {
        padding: 10px;
        font-size: 14px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header > div:first-child {
        flex-direction: column;
        align-items: stretch !important;
    }

    .header > div:first-child > div:last-child {
        margin-top: 20px;
        text-align: left !important;
    }

    .header button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .health-tooltip {
        min-width: 250px;
        max-width: 90vw;
    }
}
