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

body {
    font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    padding: 28px 32px 32px;
}

/* الهيدر مع الشعار */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

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

.logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    padding: 6px;
}

.logo-text h1 {
    font-size: 2.1rem;
    margin-bottom: 4px;
}

.logo-text .subtitle {
    margin-bottom: 0;
}

.header-badge span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(39, 174, 96, 0.18);
    color: #eafaf1;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    border: 1px solid rgba(39, 174, 96, 0.6);
}

header > p {
    margin-top: 12px;
    max-width: 960px;
}

/* العناوين العامة */

h1 {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.nav-tabs {
    display: flex;
    background: #2c3e50;
    overflow-x: auto;
}

.tab {
    padding: 15px 24px;
    background: transparent;
    border: none;
    color: #ecf0f1;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tab.active {
    background: rgba(255, 255, 255, 0.12);
    border-bottom: 3px solid #3498db;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.4s;
}

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

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

/* الشبكات */

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

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

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

.full-width {
    grid-column: 1 / -1;
}

/* البطاقات */

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.03);
}

.card h2,
.card h3 {
    margin-bottom: 12px;
    color: #2c3e50;
}

.card p {
    margin-bottom: 8px;
}

.key-metrics li,
.sim-results li,
.card ul li,
.card ol li {
    margin-bottom: 6px;
}

.key-metrics span {
    color: #555;
}

.key-metrics strong {
    color: #2c3e50;
}

/* النماذج */

label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

input[type="number"],
input[type="range"] {
    width: 100%;
    margin-top: 4px;
}

input[type="number"] {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #d0d7de;
    font-size: 0.9rem;
}

input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 1px rgba(52, 152, 219, 0.2);
}

.section-note {
    margin-bottom: 16px;
    color: #555;
}

.primary-btn {
    background: #27ae60;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn:hover {
    background: #219653;
    transform: translateY(-1px);
}

/* أشرطة التمرير */

.slider-value {
    display: inline-block;
    margin-top: 4px;
    font-weight: 600;
    color: #2c3e50;
}

.sim-results strong {
    color: #2c3e50;
}

/* بطاقات المؤشرات */

.kpi-card {
    text-align: center;
}

.kpi-card h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.kpi-card p {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c3e50;
}

/* نتائج الحاسبة */

.results-row {
    margin-top: 20px;
}

/* الفوتر */

footer {
    text-align: center;
    padding: 18px 10px 24px;
    background: #2c3e50;
    color: #ecf0f1;
    border-top: 1px solid #34495e;
}

.download-btn {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin: 12px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.download-btn:hover {
    background: #219653;
    transform: translateY(-2px);
}

.small-note {
    font-size: 0.8rem;
    color: #777;
    margin-top: 8px;
}

/* استجابة الشاشات الصغيرة */

@media (max-width: 768px) {
    header {
        padding: 20px 16px 24px;
    }

    .header-top {
        align-items: flex-start;
    }

    .logo-text h1 {
        font-size: 1.6rem;
    }

    .tab {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    .tab-content {
        padding: 20px;
    }
}
