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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    background: white;
    color: #495057;
    font-size: 1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.nav-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

main {
    padding: 30px;
    min-height: 500px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.5em;
    color: #6c757d;
}

.error {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.error h2 {
    margin-bottom: 15px;
}

/* CapEx Tracker Styles */
.capex-tracker {
    animation: fadeIn 0.5s ease;
}

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

.capex-tracker .header {
    text-align: center;
    margin-bottom: 40px;
}

.capex-tracker .header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.capex-tracker .subtitle {
    color: #6c757d;
    font-size: 1.1em;
}

.controls {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.company-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.company-toggle {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.company-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.company-toggle input {
    margin-right: 8px;
    cursor: pointer;
}

.company-toggle span {
    font-weight: 600;
    font-size: 0.95em;
}

.chart-container {
    height: 450px;
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alerts-section {
    margin: 40px 0;
}

.alerts-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.alert {
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.alert:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alert-high { border-left-color: #dc3545; background: #fff5f5; }
.alert-medium { border-left-color: #ffc107; background: #fffbf0; }
.alert-low { border-left-color: #28a745; background: #f0fff4; }
.alert-info { border-left-color: #17a2b8; background: #f0f9ff; }

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

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
}

.badge-high { background: #dc3545; }
.badge-medium { background: #ffc107; color: #000; }
.badge-low { background: #28a745; }
.badge-info { background: #17a2b8; }

.stats-section {
    margin: 40px 0;
}

.stats-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.stats-table {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

thead tr {
    background: #667eea;
    color: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .navigation {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .alerts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Dependency Graph Styles - Added Phase 3 */
/* Dependency Graph Styles */

.dependency-graph-container {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.graph-header {
    text-align: center;
    margin-bottom: 30px;
}

.graph-header h2 {
    font-size: 32px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.graph-header p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

.graph-controls {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.control-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.control-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.control-group select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    cursor: pointer;
}

.control-group select option {
    background: #667eea;
    color: white;
}

.stats-panel {
    display: flex;
    gap: 20px;
    margin-left: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

#graph-canvas {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#graph-canvas svg {
    display: block;
}

.graph-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.graph-node circle {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.graph-node:hover circle {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.node-label {
    fill: #333;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.graph-link {
    transition: all 0.3s ease;
}

.graph-legend {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
}

.graph-legend h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.node-details {
    position: fixed;
    top: 100px;
    right: 30px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    max-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

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

.node-details h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.node-details p {
    margin: 8px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.node-details strong {
    color: #4ECDC4;
}

.node-details ul {
    margin: 5px 0;
    padding-left: 20px;
    list-style: none;
}

.node-details li {
    margin: 4px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    position: relative;
}

.node-details li::before {
    content: '→';
    position: absolute;
    left: -15px;
    color: #4ECDC4;
}

/* Responsive design */
@media (max-width: 1024px) {
    .graph-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-panel {
        margin-left: 0;
        width: 100%;
        justify-content: space-around;
    }
    
    .node-details {
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .dependency-graph-container {
        padding: 15px;
    }
    
    .graph-header h2 {
        font-size: 24px;
    }
    
    .graph-header p {
        font-size: 14px;
    }
    
    #graph-canvas {
        height: 500px !important;
    }
    
    .legend-items {
        flex-direction: column;
    }
}
/* Dashboard and Companies View Styles */

.dashboard-container, .companies-container {
    padding: 20px;
}

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

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.dashboard-card h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.dashboard-card p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.card-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-stats span {
    font-size: 13px;
    color: #555;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 6px;
}

.quick-actions {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
}

.quick-actions h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
}

.action-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Companies View */

.industry-section {
    margin-bottom: 40px;
}

.industry-header {
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-size: 18px;
    margin: 0 0 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.company-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #667eea;
}

.company-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

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

.company-header strong {
    font-size: 16px;
    color: #333;
}

.ticker {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.company-card p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 10px 0;
}

.company-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 10px;
}

.summary-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.summary-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.summary-card strong {
    display: block;
    margin-bottom: 8px;
    color: #667eea;
    font-size: 14px;
}

/* Responsive */

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .companies-grid {
        grid-template-columns: 1fr;
    }
    
    .action-btn {
        display: block;
        width: 100%;
        margin-right: 0;
    }
}
