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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

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

/* ==================== Header ==================== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 12px;
    margin-bottom: 24px;
}

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

.header .subtitle {
    opacity: 0.9;
    font-size: 14px;
    margin-top: 4px;
}

/* ==================== Navigation ==================== */
.nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-wrap: wrap;
}

.nav a {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav a:hover {
    background: #f5f5f5;
}

.nav a.active {
    background: #667eea;
    color: white;
}

/* ==================== Cards ==================== */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* ==================== Buttons ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

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

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

/* ==================== Stats ==================== */
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.stat-value-small {
    font-size: 20px;
    font-weight: 500;
    color: #667eea;
}

.stat-label {
    font-size: 14px;
    color: #888;
    margin-top: 8px;
}

.statcompare {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.statcompare .positive {
    color: #52c41a;
}

.statcompare .negative {
    color: #ff4d4f;
}

.stat-value.success {
    color: #52c41a;
}

.stat-value.danger {
    color: #ff4d4f;
}

/* ==================== Tables ==================== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}

.table tr:hover {
    background: #fafafa;
}

/* ==================== Badges ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
}

.badge-error {
    background: #fff2f0;
    color: #ff4d4f;
}

/* ==================== Alerts ==================== */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.alert-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

/* ==================== Tabs ==================== */
.tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* ==================== Utilities ==================== */
.empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

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

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

.mb-4 {
    margin-bottom: 16px;
}

.mt-4 {
    margin-top: 16px;
}

.text-muted {
    color: #999;
}

.text-sm {
    font-size: 13px;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .header {
        padding: 16px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .nav {
        gap: 4px;
        padding: 8px;
    }
    
    .nav a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .card {
        padding: 16px;
    }
    
    .grid, .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th, .table td {
        padding: 8px;
    }
}
