:root {
    --primary: #0078d4;
    --primary-dark: #005a9e;
    --accent: #107c10;
    --bg: #f3f2f1;
    --card-bg: #ffffff;
    --text-main: #201f1e;
    --text-muted: #605e5c;
    --border-subtle: #e1dfdd;
    --danger: #d13438;
}

/* Reset بسيط */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
}

body.rtl {
    direction: rtl;
}

/* تخطيط عام */
.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ====== الـ Navbar ====== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

.brand-text-main {
    font-weight: 600;
    font-size: 1rem;
}

.brand-text-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.9rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    position: relative;
    padding-bottom: 2px;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: var(--primary);
    transition: width 0.2s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Language toggle */

.lang-toggle {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    background: #faf9f8;
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
}

/* RTL adjustments */
body.rtl .navbar {
    flex-direction: row-reverse;
}

body.rtl .nav-left {
    flex-direction: row-reverse;
}

/* ====== المحتوى الرئيسي ====== */

.app-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Hero */

.hero {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 2.25rem;
    background:
        linear-gradient(120deg, rgba(0, 88, 163, 0.92), rgba(0, 120, 212, 0.88)),
        url("hero-ceo-chair.jpg") center/cover no-repeat;
    color: #fff;
    display: flex;
    align-items: stretch;
    min-height: 320px;
}

.hero-content {
    padding: 2.5rem 2.75rem;
    max-width: 60%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fadeUp 0.7s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 0.95rem;
    opacity: 0.96;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    opacity: 0.96;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 0.75rem;
}

.btn {
    border-radius: 999px;
    border: none;
    padding: 0.55rem 1.2rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease,
        color 0.1s ease;
}

.btn-primary {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.btn-ghost {
    background: rgba(0, 0, 0, 0.18);
    color: #fff;
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.28);
}

.hero-side {
    flex: 1;
    padding: 2rem 2.25rem 2rem 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.8rem;
    font-size: 0.8rem;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.1), transparent);
}

.hero-metric-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.hero-metric {
    flex: 1;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
}

.hero-metric-label {
    font-size: 0.7rem;
    opacity: 0.9;
}

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

/* Section header */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
}

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

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Layout grid */

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 1.4rem;
    margin-bottom: 2rem;
}

/* Cards */

.card {
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    padding: 1.3rem 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

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

.card-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.card-list {
    list-style: none;
    margin-top: 0.4rem;
}

.card-list li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

/* Articles grid */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    padding: 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border 0.12s ease;
    cursor: default;
}

.article-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 120, 212, 0.5);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
}

.article-tagline {
    font-size: 0.75rem;
    color: var(--primary-dark);
    font-weight: 500;
}

.article-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.article-body {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Contact */

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr);
    gap: 1.4rem;
    margin-top: 0.8rem;
}

.contact-meta-item {
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.contact-meta-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.contact-meta-value a {
    color: var(--primary-dark);
    text-decoration: none;
}

.contact-meta-value a:hover {
    text-decoration: underline;
}

/* Form */

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.form-field label {
    color: var(--text-muted);
    font-weight: 500;
}

.form-field input,
.form-field textarea {
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    padding: 0.55rem 0.7rem;
    font-size: 0.85rem;
    outline: none;
    background: #faf9f8;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.25);
    background: #fff;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.btn-ghost-secondary {
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: #faf9f8;
    color: var(--text-muted);
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-ghost-secondary:hover {
    background: #f0f0ef;
}

/* Footer */

.app-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 0.9rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.app-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* ===== Admin page ===== */

.admin-shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
}

.admin-header-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.admin-header-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.admin-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
    gap: 1.2rem;
}

.admin-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.admin-login-card {
    max-width: 420px;
}

.admin-alert {
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.admin-alert.error {
    color: var(--danger);
}

.admin-alert.success {
    color: var(--accent);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 0.6rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.45rem 0.4rem;
    text-align: start;
}

.admin-table th {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.btn-small {
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: #faf9f8;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

.btn-small.danger {
    border-color: rgba(209, 52, 56, 0.35);
    color: var(--danger);
    background: #fdf3f4;
}

.btn-small.danger:hover {
    background: #fbe1e3;
}

/* RTL for admin */
body.rtl .admin-table th,
body.rtl .admin-table td {
    text-align: start;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        min-height: auto;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-side {
        padding-top: 0;
    }

    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2,
    .contact-layout,
    .admin-panel {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .app-main {
        padding: 1rem;
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .articles-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero {
        border-radius: 18px;
    }
}

/* Animation */

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