:root {
    --primary: #0F4C35;
    --primary-light: #1A7A56;
    --primary-dark: #0A3425;
    --accent: #00C9A7;
    --accent-dark: #00A88A;
    --accent-glow: rgba(0,201,167,0.15);
    --gold: #F0B429;
    --gold-dark: #D49B1F;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg: #F7FAF8;
    --bg-alt: #EDF5F0;
    --card: #ffffff;
    --text: #1a2e23;
    --text-light: #5a7265;
    --border: #d4e5da;
    --shadow: 0 1px 3px rgba(15,76,53,0.06), 0 4px 12px rgba(15,76,53,0.04);
    --shadow-md: 0 4px 16px rgba(15,76,53,0.08);
    --shadow-lg: 0 8px 30px rgba(15,76,53,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

/* ─── Navbar ────────────────────────────────── */
.navbar {
    background: rgba(15,76,53,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 64px;
    gap: 1rem;
}

.nav-logo {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.logo-icon { font-size: 1.6rem; }
.nav-logo-img { height: 38px; border-radius: 6px; }

.nav-links {
    display: flex;
    gap: 0.2rem;
    flex: 1;
}

.nav-link {
    color: rgba(255,255,255,0.75);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
    font-size: 0.88rem;
    white-space: nowrap;
    font-weight: 500;
}

.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-admin { color: var(--accent); font-weight: 600; }
.nav-admin:hover { color: var(--accent); background: rgba(0,201,167,0.1); }

.nav-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
}
.nav-toggle:hover { background: rgba(255,255,255,0.1); }

/* ─── Buttons ───────────────────────────────── */
.btn {
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); color: white; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: var(--primary-dark); font-weight: 700; }
.btn-accent:hover { background: var(--accent-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,201,167,0.3); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--primary); color: white; }
.btn-outline-light { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.35); }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); color: white; }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2.2rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Cards ─────────────────────────────────── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-body { padding: 1.5rem; }
.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    background: var(--bg-alt);
}
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg-alt); }
.card-flat { box-shadow: none; border: 1px solid var(--border); }
.card-flat:hover { transform: none; box-shadow: var(--shadow); }

/* ─── Forms ─────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    direction: rtl;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-full { grid-column: 1 / -1; }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 0.3rem; }

.password-wrapper { position: relative; }
.password-toggle {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-light);
    padding: 0.2rem;
    border-radius: 4px;
    transition: color var(--transition);
}
.password-toggle:hover { color: var(--primary); }

/* ─── Flash Messages ────────────────────────── */
.flash-container {
    max-width: 1200px;
    margin: 0.5rem auto;
    padding: 0 1.5rem;
}

.flash {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.flash button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 0.3rem;
    transition: opacity var(--transition);
}
.flash button:hover { opacity: 1; }

.flash-success { background: #ECFDF5; color: #065F46; border-right: 4px solid var(--success); }
.flash-error { background: #FEF2F2; color: #991B1B; border-right: 4px solid var(--danger); }
.flash-warning { background: #FFFBEB; color: #92400E; border-right: 4px solid var(--warning); }
.flash-info { background: #ECFDF5; color: #065F46; border-right: 4px solid var(--accent); }

/* ─── Layout ────────────────────────────────── */
.main-content { flex: 1; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-sm { max-width: 600px; }
.container-md { max-width: 800px; }

.section { padding: 3rem 0; }
.section-title {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* ─── Hero ──────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, #0A3425 0%, #0F4C35 30%, #1A7A56 65%, #00C9A7 100%);
    color: white;
    padding: 5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(0,201,167,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(240,180,41,0.08) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }
.hero-logo {
    height: 100px;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.hero h1 {
    font-size: 2.6rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.9;
}

/* ─── Stats ─────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.8rem 1.2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform var(--transition);
}

.stat-card:hover { transform: translateY(-2px); }
.stat-card .number { font-size: 2.2rem; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }
.stat-card .label { font-size: 0.85rem; color: var(--text-light); margin-top: 0.4rem; font-weight: 500; }

/* ─── Feature Cards ─────────────────────────── */
.feature-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    display: block;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
    background: var(--accent-glow);
}

.feature-card h3 { color: var(--primary); margin-bottom: 0.5rem; font-size: 1.1rem; }
.feature-card p { color: var(--text-light); font-size: 0.9rem; line-height: 1.6; }

/* ─── Badge ─────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: #ECFDF5; color: var(--primary); }
.badge-success { background: #ECFDF5; color: #065F46; }
.badge-warning { background: #FFFBEB; color: #92400E; }
.badge-danger { background: #FEF2F2; color: #991B1B; }
.badge-gray { background: #F3F4F6; color: #4B5563; }

/* ─── Table ─────────────────────────────────── */
.table-responsive { overflow-x: auto; border-radius: var(--radius); }

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--primary);
    color: white;
    padding: 0.85rem;
    text-align: right;
    font-weight: 600;
    font-size: 0.88rem;
}

table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

table tr:hover { background: var(--bg-alt); }

/* ─── Contact Row ───────────────────────────── */
.contact-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    cursor: pointer;
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    color: inherit;
}
.contact-row:hover { background: var(--bg-alt); color: inherit; }

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.contact-row h3 { color: var(--primary); margin-bottom: 0.15rem; font-size: 1rem; }
.contact-row span { font-size: 1rem; direction: ltr; display: inline-block; color: var(--primary-light); text-decoration: underline; }

/* ─── Goals List ────────────────────────────── */
.goal-item {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.7;
}
.goal-item:last-child { border-bottom: none; }
.goal-check { color: var(--accent); font-weight: 700; font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }

/* ─── Activity Grid ─────────────────────────── */
.activity-item h4 { margin-bottom: 0.4rem; color: var(--primary); font-size: 1rem; }
.activity-item p { color: var(--text-light); font-size: 0.9rem; }

/* ─── Footer ────────────────────────────────── */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.8);
    margin-top: auto;
    padding: 2.5rem 0 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.footer-section h3, .footer-section h4 {
    color: white;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.footer-section p { font-size: 0.9rem; line-height: 1.7; opacity: 0.85; }

.footer-section a {
    display: block;
    color: rgba(255,255,255,0.7);
    padding: 0.25rem 0;
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-section a:hover { color: var(--accent); }

.footer-bottom {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.2rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ─── Utilities ─────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ─── Timeline ──────────────────────────────── */
.timeline { position: relative; padding-right: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent), var(--primary-light));
    border-radius: 3px;
}

.timeline-item { position: relative; margin-bottom: 2rem; padding-right: 2rem; }
.timeline-item::before {
    content: '';
    position: absolute;
    right: -2.45rem;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--card);
    box-shadow: 0 0 0 2px var(--accent);
}

.timeline-date { font-size: 0.82rem; color: var(--text-light); margin-bottom: 0.3rem; font-weight: 500; }
.timeline-title { font-weight: 700; color: var(--primary); font-size: 1.05rem; }

/* ─── Tool Card ─────────────────────────────── */
.tool-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    border: 2px solid transparent;
}

.tool-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tool-card.disabled { opacity: 0.5; pointer-events: none; }
.tool-card h3 { color: var(--primary); margin: 1rem 0 0.5rem; }
.tool-card p { color: var(--text-light); font-size: 0.9rem; }
.tool-icon { font-size: 2.5rem; }

/* ─── Member Card ───────────────────────────── */
.member-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid rgba(0,0,0,0.04);
}

.member-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.member-avatar-accent {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.member-info h4 { font-size: 0.92rem; font-weight: 600; }
.member-info p { font-size: 0.8rem; color: var(--text-light); }

.member-card-expanded {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
}
.member-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
}
.member-card-details {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 0.6rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.member-detail-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-light);
    text-decoration: none;
    direction: ltr;
    text-align: left;
}
.member-detail-link:hover { color: var(--primary); }
.member-detail-icon { font-size: 0.85rem; width: 1.2em; text-align: center; }

/* ─── Section Alt Background ────────────────── */
.section-alt { background: white; }

/* ─── CTA Section ───────────────────────────── */
.cta-section {
    padding: 3.5rem 1.5rem;
    text-align: center;
}
.cta-section h2 { color: var(--primary); margin-bottom: 0.8rem; font-size: 1.5rem; }
.cta-section p { color: var(--text-light); margin-bottom: 1.5rem; }

/* ─── Auth Page ─────────────────────────────── */
.auth-page { padding-top: 3rem; }
.auth-card { padding: 2rem; }
.auth-title { color: var(--primary); text-align: center; margin-bottom: 1.5rem; font-size: 1.4rem; }
.auth-subtitle { text-align: center; margin-bottom: 1.5rem; }
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.auth-footer a { font-weight: 600; }

/* ─── Card Inner Headings ───────────────────── */
.card-title { color: var(--primary); margin-bottom: 1rem; font-size: 1.15rem; }
.card-content { line-height: 1.9; }
.card-content + .card-content { margin-top: 1rem; }

/* ─── Separator ─────────────────────────────── */
.section-sep {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-actions { display: none; }
    .nav-toggle { display: block; }

    .navbar.open .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding-bottom: 0.5rem;
    }

    .navbar.open .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        order: 10;
        padding: 0.5rem 0;
    }

    .navbar.open .nav-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        order: 11;
        padding: 0.5rem 0 0.5rem;
        gap: 0.5rem;
    }

    .navbar.open .nav-links .nav-link {
        padding: 0.6rem 0.5rem;
        border-radius: var(--radius-xs);
    }

    .navbar.open .nav-links .nav-link:hover {
        background: rgba(255,255,255,0.1);
    }

    .hero { padding: 3.5rem 1.5rem; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; }
    .grid-2, .grid-3, .grid-4, .stats-row { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .footer-container { grid-template-columns: 1fr; }
    .container { padding: 1.2rem 1rem; }
}
