* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --bg-color: #1a1a1a;
    --card-bg: #252525;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #3a3a3a;
    --accent-color: #4a89dc;
    --accent-hover: #3a79cc;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 1.8rem;
}

.airline-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.airline-selector-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.airline-selector-container label {
    margin-right: 10px;
    font-weight: 500;
}

#airline-selector {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
}

#airline-selector:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(74, 137, 220, 0.2);
}

#refresh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

#refresh-button:hover {
    background-color: var(--accent-color);
    color: white;
}

#refresh-button:active {
    transform: scale(0.95);
}

#refresh-button.refreshing {
    pointer-events: none;
    opacity: 0.7;
}

#refresh-button.refreshing svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#airline-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

#last-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    transition: opacity 0.3s ease;
}

.card.loading {
    opacity: 0.7;
}

.card.loading .loading-indicator {
    display: block;
}

.loading-indicator {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 20px;
    top: 22px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric {
    display: flex;
    justify-content: space-between;
}

.metric-name {
    color: var(--text-muted);
}

.metric-value {
    font-weight: 500;
}

.positive {
    color: var(--success-color);
}

.negative {
    color: var(--danger-color);
}

.warning {
    color: var(--warning-color);
}

.chart-container {
    height: 200px;
    margin-top: 10px;
}

.time-of-day-stats,
.hourly-stats {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.time-of-day-stats h3,
.hourly-stats h3 {
    font-size: 1rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.time-of-day-stats .metric,
.hourly-stats .metric {
    margin: 5px 0;
    font-size: 0.9rem;
}

#hourly-chart {
    height: 150px;
    margin-top: 15px;
    background: var(--card-bg);
    border-radius: 4px;
    padding: 10px;
}

.analytics-data {
    width: 100%;
}

.metric-header {
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 5px;
}

.hourly-profits-chart {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 5px;
}

.transaction-item:last-child,
.purchase-item:last-child,
.route-item:last-child,
.departure-item:last-child {
    border-bottom: none !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .airline-info {
        margin-top: 10px;
        align-items: flex-start;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    #refresh-button {
        margin-left: 5px;
    }
}