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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: #002FA7;
    color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    background: #FFFFFF;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #B7B7B7;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #EFEFEF;
    color: #000000;
}

.tab-btn.active {
    background: #002FA7;
    color: #FFFFFF;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    min-height: 600px;
    width: 100%;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
}

/* Chart containers */
.card > div[id$="-chart"] {
    min-height: 600px;
    width: 100%;
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    transition: background 0.3s ease;
    border: 2px solid #cbd5e1;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: #3b82f6;
    border-color: #1d4ed8;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.control-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.control-group select,
.control-group input {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.3s ease;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive charts for full screen */
@media (min-width: 1200px) {
    .card {
        min-height: 800px;
    }
    
    .card > div[id$="-chart"] {
        min-height: 700px;
    }
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.metric.highlight-metric {
    background: linear-gradient(135deg, #002FA7 0%, #001F69 100%);
    border: 2px solid #002FA7;
    box-shadow: 0 4px 8px rgba(0, 47, 167, 0.2);
}

.metric.highlight-metric .metric-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.metric.highlight-metric .metric-value {
    color: #FFFFFF;
    font-size: 1.75rem;
}

.metric-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 4px;
    text-align: center;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

/* Teams */
.teams-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

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

.budget-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.budget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
}

.budget-item.preb {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    border: 1px solid #34d399;
    box-shadow: 0 2px 4px rgba(52, 211, 153, 0.1);
}

.budget-item.fixed {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    color: #001F69;
    border: 1px solid #002FA7;
    box-shadow: 0 2px 4px rgba(0, 47, 167, 0.1);
}

.budget-item.flex {
    background: linear-gradient(135deg, #fff5f0 0%, #ffe6d9 100%);
    color: #EC662F;
    border: 1px solid #EC662F;
    box-shadow: 0 2px 4px rgba(236, 102, 47, 0.1);
}

.budget-label {
    font-weight: 500;
}

.budget-amount {
    font-weight: 600;
}

/* Headcount Summary */
.headcount-summary {
    margin-bottom: 24px;
}

.summary-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #f59e0b);
}

.summary-card h3 {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

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

.headcount-breakdown.second-line {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.headcount-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.headcount-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.headcount-metric.total {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #1d4ed8;
}

.headcount-metric.total .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

.headcount-metric.total .metric-value {
    color: white;
    font-weight: 700;
}

.headcount-metric.fixed-total {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
}

.headcount-metric.fixed-total .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

.headcount-metric.fixed-total .metric-value {
    color: white;
    font-weight: 700;
}

.headcount-metric .metric-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.headcount-metric .metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* Department Cards */
.department-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.department-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #065f46, #10b981, #3b82f6, #8b5cf6);
}

.department-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.department-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.department-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.department-budget-type {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    letter-spacing: 0.5px;
}

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

.department-detail {
    display: flex;
    flex-direction: column;
}

.department-detail-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 2px;
}

.department-detail-value {
    font-weight: 500;
    color: #1e293b;
}

.teams-section {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.teams-section h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #374151;
}

.teams-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.team-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.team-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-name {
    font-weight: 500;
    color: #1e293b;
}

.team-headcount {
    color: #64748b;
    font-size: 0.75rem;
}

.team-budgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
    font-size: 0.75rem;
}

.team-budget-item {
    padding: 4px 6px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

.team-budget-item.preb {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #065f46;
    border: 1px solid #a7f3d0;
    box-shadow: 0 1px 3px rgba(6, 95, 70, 0.1);
    font-weight: 600;
}

.team-budget-item.fixed {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #a7f3d0;
    box-shadow: 0 1px 3px rgba(22, 101, 52, 0.1);
    font-weight: 600;
}

.team-budget-item.flex {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
    box-shadow: 0 1px 3px rgba(30, 64, 175, 0.1);
    font-weight: 600;
}

.team-budget-total {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    font-weight: 700;
    padding: 6px 8px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.budget-item.manager {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #B7B7B7;
    border: 1px solid #B7B7B7;
    box-shadow: 0 2px 4px rgba(183, 183, 183, 0.1);
}

.budget-item.hr {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

.budget-item.hr-fixed {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #1e40af;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.1);
}

.budget-item.hr-flex {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    color: #0369a1;
    border: 1px solid #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

/* Teams Management */
.teams-management {
    max-height: 500px;
    overflow-y: auto;
}

#teams-modal {
    z-index: 1001 !important;
}

#teams-modal .modal-content {
    position: relative;
    z-index: 1002;
}

#team-modal {
    z-index: 1003 !important;
}

#team-modal .modal-content {
    position: relative;
    z-index: 1004;
}

#department-modal {
    z-index: 1005 !important;
}

#department-modal .modal-content {
    position: relative;
    z-index: 1006;
}

.teams-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.teams-list-header h3 {
    margin: 0;
    color: #374151;
}

.team-management-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
}

.team-management-item .team-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.team-management-item .team-actions {
    display: flex;
    gap: 8px;
}

.department-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.budget-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.budget-input-group {
    display: flex;
    flex-direction: column;
}

.budget-input-group label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-input-group input {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.budget-input-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Timeline Inputs */
.timeline-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.timeline-input-group {
    display: flex;
    flex-direction: column;
}

.timeline-input-group label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-input-group input {
    padding: 8px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.timeline-input-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.team-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.team-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.team-budget-type {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.team-budget-type.preb {
    background: #dcfce7;
    color: #166534;
}

.team-budget-type.fixed {
    background: #fef3c7;
    color: #92400e;
}

.team-budget-type.flex {
    background: #dbeafe;
    color: #1e40af;
}

.team-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.team-detail {
    display: flex;
    flex-direction: column;
}

.team-detail-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 2px;
}

.team-detail-value {
    font-weight: 500;
    color: #1e293b;
}

.team-actions {
    display: flex;
    gap: 8px;
}

/* Scenarios */
.scenarios-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.scenario-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

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

/* Ramp Up Hypothesis */
.rampup-header {
    text-align: center;
    margin-bottom: 30px;
}

.rampup-header h2 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.rampup-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.rampup-controls {
    margin-bottom: 30px;
}

.control-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.control-section h3 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

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

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

.timeline-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    font-weight: 600;
    color: #3b82f6;
    min-width: 80px;
    text-align: right;
}

.rampup-results {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

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

.summary-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.summary-metric .metric-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 4px;
    text-align: center;
}

.summary-metric .metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}

/* Import/Export */
.import-export-header {
    margin-bottom: 24px;
}

.import-export-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: #002FA7;
    color: #FFFFFF;
    border: 1px solid #002FA7;
}

.btn-primary:hover {
    background: #001F69;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 47, 167, 0.4);
}

.btn-secondary {
    background: #B7B7B7;
    color: #000000;
    border: 1px solid #B7B7B7;
}

.btn-secondary:hover {
    background: #EFEFEF;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(183, 183, 183, 0.4);
}

.btn-danger {
    background: #EC662F;
    color: #FFFFFF;
    border: 1px solid #EC662F;
}

.btn-danger:hover {
    background: #d45a2a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(236, 102, 47, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    margin: 5% auto;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #065f46, #10b981, #3b82f6, #8b5cf6);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

/* Form */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Charts */
.chart-container {
    height: 300px;
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    .scenario-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #64748b;
}

/* Success/Error States */
.success {
    background: #dcfce7;
    color: #166534;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.error {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* Runway Burn Categories */
.burn-categories-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.burn-categories-section h4 {
    margin: 0 0 16px 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

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

.burn-category {
    background: white;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.burn-category label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.burn-category input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.burn-category input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Runway Info */
.runway-info {
    background: white;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-top: 16px;
}

.info-item {
    margin-bottom: 12px;
}

.info-label {
    font-weight: 500;
    color: #374151;
    margin-right: 8px;
}

.info-value {
    font-weight: 600;
    color: #1f2937;
}

.budget-breakdown {
    margin-top: 8px;
}

.budget-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
}

.budget-item:last-child {
    border-bottom: none;
    font-weight: 600;
    color: #1f2937;
}

/* Check Tab */
.check-header {
    text-align: center;
    margin-bottom: 30px;
}

.check-header h2 {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 8px;
}

.check-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.check-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
    justify-content: center;
}

.check-results {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.check-summary {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.check-summary h3 {
    margin-bottom: 16px;
    color: #1e293b;
    font-size: 1.25rem;
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.stat-label {
    font-weight: 500;
    color: #64748b;
}

.stat-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.stat-value.passed {
    color: #059669;
}

.stat-value.failed {
    color: #dc2626;
}

.stat-value.warning {
    color: #d97706;
}

.check-categories {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.check-category {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.check-category h3 {
    margin-bottom: 16px;
    color: #1e293b;
    font-size: 1.25rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.check-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.check-item.passed {
    border-left: 4px solid #059669;
}

.check-item.failed {
    border-left: 4px solid #dc2626;
}

.check-item.warning {
    border-left: 4px solid #d97706;
}

.check-status {
    margin-right: 12px;
    font-size: 1.2rem;
}

.check-status.passed::before {
    content: "✓";
    color: #059669;
}

.check-status.failed::before {
    content: "✗";
    color: #dc2626;
}

.check-status.warning::before {
    content: "⚠";
    color: #d97706;
}

.check-details {
    flex: 1;
}

.check-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.check-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.check-values {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: #64748b;
}

.check-value {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.check-value-label {
    font-weight: 500;
    color: #374151;
}

.check-value-amount {
    font-family: 'Courier New', monospace;
    color: #1e293b;
}

.debug-section {
    margin-top: 16px;
    padding: 16px;
    background: #f1f5f9;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.debug-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.debug-content {
    background: #1e293b;
    color: #f8fafc;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
}

.debug-content pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Summary View Styles */
.summary-view-header {
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-view-header h2 {
    color: #002FA7;
    font-size: 1.8rem;
    font-weight: 700;
}

.summary-view-container {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 210mm; /* A4 width */
    margin: 0 auto;
}

.summary-dept-card {
    margin-bottom: 40px;
    page-break-inside: avoid;
    border: 2px solid #002FA7;
    border-radius: 8px;
    overflow: hidden;
}

.summary-dept-header {
    background: linear-gradient(135deg, #002FA7 0%, #001F69 100%);
    color: #ffffff;
    padding: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-export-btn {
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
    background: #ffffff !important;
    color: #002FA7 !important;
    border: none !important;
    font-weight: 600 !important;
}

.summary-export-btn:hover {
    background: #EC662F !important;
    color: #ffffff !important;
}

.summary-dept-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.summary-metric {
    display: flex;
    flex-direction: column;
}

.summary-metric-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.summary-metric-value {
    font-size: 1.1rem;
    color: #002FA7;
    font-weight: 700;
}

.summary-teams-section {
    padding: 20px;
}

.summary-teams-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #EC662F;
}

.summary-team-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 12px;
    margin-bottom: 8px;
    background: #ffffff;
    border-left: 4px solid #EC662F;
    border-radius: 4px;
}

.summary-team-item:hover {
    background: #f8fafc;
}

.summary-team-name {
    font-weight: 600;
    color: #001F69;
}

.summary-team-field {
    display: flex;
    flex-direction: column;
}

.summary-team-field-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.summary-team-field-value {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}

.summary-page-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #002FA7;
}

.summary-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #002FA7;
    margin-bottom: 8px;
}

.summary-page-subtitle {
    font-size: 1.1rem;
    color: #64748b;
}

@media print {
    .summary-view-header {
        display: none;
    }
    
    .summary-view-container {
        box-shadow: none;
        padding: 20px;
    }
    
    .summary-dept-card {
        page-break-inside: avoid;
    }
}

/* Finance Summary Table Styles */
.finance-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.finance-summary-header h2 {
    color: #002FA7;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.finance-summary-table {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    min-width: fit-content;
}

.finance-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 0.88rem;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    background: #ffffff;
}

.finance-table thead {
    background: linear-gradient(135deg, #002FA7 0%, #001F69 100%);
    color: #ffffff;
}

.finance-table thead th {
    padding: 16px 12px;
    text-align: right;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.finance-table thead th:first-child {
    text-align: left;
    min-width: 200px;
}

.finance-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.finance-table tbody tr:hover {
    background: #f8fafc;
}

.finance-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.finance-table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}

.finance-table tbody td {
    padding: 14px 12px;
    text-align: right;
    color: #334155;
    font-weight: 300;
    border: 1px solid #e2e8f0;
}

.finance-table tbody td:first-child {
    text-align: left;
    font-weight: 400;
    color: #001F69;
}

/* Department rows */
.finance-table tbody tr.dept-row td {
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    font-weight: 700;
    color: #002FA7;
    border-left: 4px solid #002FA7;
}

/* Total row */
.finance-table tfoot {
    background: linear-gradient(135deg, #001F69 0%, #002FA7 100%);
    color: #ffffff;
    font-weight: 700;
}

.finance-table tfoot td {
    padding: 18px 12px;
    text-align: right;
    font-size: 0.98rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.finance-table tfoot td:first-child {
    text-align: left;
}

/* Number formatting */
.finance-number {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
}

/* Subtotal rows */
.finance-table tbody tr.subtotal-row {
    background: #e0e7ff !important;
    font-weight: 700;
}

.finance-table tbody tr.subtotal-row td {
    color: #001F69;
    border-top: 2px solid #002FA7;
    border-bottom: 2px solid #002FA7;
}

/* Table header with date */
.finance-table-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #002FA7;
}

.finance-table-title {
    font-size: 1.53rem;
    font-weight: 700;
    color: #002FA7;
    margin-bottom: 5px;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.finance-table-date {
    font-size: 0.83rem;
    color: #64748b;
    font-weight: 300;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media print {
    .finance-summary-header {
        display: none;
    }
    
    .finance-summary-table {
        box-shadow: none;
        padding: 10px;
    }
}

/* Login Overlay Styles */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #001a5c 0%, #002FA7 50%, #0044cc 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
}

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

.login-logo {
    font-size: 3rem;
    font-weight: 700;
    color: #002FA7;
    letter-spacing: -1px;
    margin-bottom: 8px;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.login-subtitle {
    font-size: 1rem;
    color: #64748b;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.3px;
}

.login-input-group input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    transition: all 0.3s ease;
    outline: none;
}

.login-input-group input:focus {
    border-color: #002FA7;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 47, 167, 0.1);
}

.login-input-group input::placeholder {
    color: #94a3b8;
}

.login-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #002FA7 0%, #0044cc 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 47, 167, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 47, 167, 0.4);
    background: linear-gradient(135deg, #0033b8 0%, #0055dd 100%);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    color: #dc2626;
    font-size: 0.875rem;
    text-align: center;
    min-height: 20px;
    margin: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-error.visible {
    opacity: 1;
}

/* Shake animation for wrong password */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-card.shake {
    animation: shake 0.5s ease-in-out;
}
