:root {
    --samta-green: #0f766e;
    --samta-green-dark: #0a5f59;
    --samta-gold: #c8a24a;
    --samta-ink: #132d2b;
    --samta-muted: #657775;
    --samta-line: #d9e8e5;
    --samta-soft: #f4f9f8;
    --samta-white: #ffffff;
    --samta-admin-offset: 0px;
}

html,
body.samta-standalone-tools-template {
    margin: 0;
    min-height: 100%;
    background: #fff;
}

body.admin-bar {
    --samta-admin-offset: 32px;
}

.samta-clean-tools-layout,
.samta-clean-tools-layout * {
    box-sizing: border-box;
}

.samta-standalone-shell,
.samta-mobile-page-top,
.samta-tool-workspace,
.samta-tools-portal {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* واجهة جوال موحّدة على جميع الشاشات. */
.samta-mobile-page-top {
    padding: 0;
    background: #fff;
}

.samta-tool-title-banner-wrap {
    width: min(1120px, calc(100% - 24px));
    margin: 10px auto 0;
    padding: 0 0 6px;
}

.samta-tool-title-banner {
    min-height: 58px;
    width: 100%;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(200, 162, 74, .38);
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(242, 249, 247, .98), rgba(255, 249, 236, .96));
    box-shadow: 0 10px 28px rgba(16, 54, 50, 0.08);
}

.samta-tool-title-banner-text {
    margin: 0 !important;
    color: var(--samta-ink) !important;
    font-size: clamp(22px, 3.8vw, 30px) !important;
    line-height: 1.25 !important;
    font-weight: 900 !important;
    text-align: center;
    white-space: nowrap;
}

.samta-tool-title-arrow {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    color: var(--samta-green-dark);
    font-size: clamp(18px, 3vw, 24px);
    line-height: 1;
}

.samta-tools-header {
    position: sticky;
    top: var(--samta-admin-offset);
    z-index: 9990;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--samta-line);
    box-shadow: 0 8px 24px rgba(16, 54, 50, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.samta-tools-header-inner {
    position: relative;
    width: min(520px, calc(100% - 22px));
    min-height: 58px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.samta-tools-brand {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--samta-ink) !important;
    text-decoration: none !important;
}

.samta-tools-brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--samta-green-dark);
    background: #fff4cf;
    border: 1px solid #ead28b;
    font-size: 20px;
    font-weight: 900;
}

.samta-tools-brand-copy {
    min-width: 0;
    display: grid;
    line-height: 1.2;
}

.samta-tools-brand-copy strong {
    overflow: hidden;
    color: var(--samta-ink);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.samta-tools-brand-copy small {
    display: none;
}

.samta-tools-menu-button {
    margin-inline-start: auto;
    min-height: 42px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--samta-line);
    border-radius: 11px;
    color: var(--samta-ink);
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.samta-tools-menu-lines,
.samta-tools-menu-lines::before,
.samta-tools-menu-lines::after {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 10px;
    background: currentColor;
}

.samta-tools-menu-lines { position: relative; }
.samta-tools-menu-lines::before,
.samta-tools-menu-lines::after {
    position: absolute;
    right: 0;
    content: '';
}
.samta-tools-menu-lines::before { top: -5px; }
.samta-tools-menu-lines::after { top: 5px; }

.samta-tools-navigation {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    margin: 0;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    border: 1px solid var(--samta-line);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(14, 50, 47, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.samta-tools-header.is-menu-open .samta-tools-navigation {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.samta-tools-nav-link {
    min-height: 42px;
    padding: 8px 11px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    border: 1px solid #edf2f1;
    border-radius: 11px;
    color: #35514e !important;
    background: #fbfdfd;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 800;
}

.samta-tools-nav-link:hover,
.samta-tools-nav-link:focus-visible {
    color: var(--samta-green-dark) !important;
    background: #edf7f5;
}

.samta-tools-nav-link.is-active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--samta-green), var(--samta-green-dark));
    box-shadow: 0 7px 18px rgba(15, 118, 110, .19);
}

.samta-tools-nav-icon {
    width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
}

.samta-tools-nav-icon svg,
.samta-portal-card-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.samta-tool-workspace {
    padding: 15px 6px 38px;
    overflow-x: clip;
    background: #fff;
}

.samta-tool-workspace > :first-child {
    margin-top: 0 !important;
}

/* البوابة نفسها تستخدم ترتيب الجوال حتى على الكمبيوتر. */
.samta-tools-portal {
    min-height: 100vh;
    color: var(--samta-ink);
    background:
        radial-gradient(circle at 88% 15%, rgba(200, 162, 74, .12), transparent 28%),
        radial-gradient(circle at 12% 35%, rgba(15, 118, 110, .10), transparent 31%),
        #f8fbfa;
}

.samta-portal-hero {
    width: min(520px, calc(100% - 24px));
    margin: 0 auto;
    padding: 45px 0 26px;
    text-align: center;
}

.samta-portal-kicker {
    display: inline-flex;
    padding: 7px 16px;
    border: 1px solid rgba(200, 162, 74, .55);
    border-radius: 999px;
    color: #8a6b1d;
    background: rgba(255, 255, 255, .75);
    font: 800 12px/1.1 system-ui, sans-serif;
    letter-spacing: 1.5px;
}

.samta-portal-hero h1 {
    margin: 18px 0 10px !important;
    color: var(--samta-ink) !important;
    font-size: clamp(30px, 7vw, 42px) !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
}

.samta-portal-hero p {
    margin: 0 auto !important;
    color: var(--samta-muted) !important;
    font-size: 15px !important;
    line-height: 1.9 !important;
}

.samta-portal-grid {
    width: min(520px, calc(100% - 24px));
    margin: 0 auto;
    padding: 12px 0 45px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
}

.samta-portal-card {
    min-height: 138px;
    padding: 18px;
    display: grid;
    grid-template-columns: 52px 1fr 34px;
    align-items: center;
    gap: 13px;
    border: 1px solid var(--samta-line);
    border-radius: 19px;
    color: var(--samta-ink) !important;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 15px 40px rgba(21, 61, 57, .07);
    text-decoration: none !important;
}

.samta-portal-card-icon {
    width: 52px;
    height: 52px;
    padding: 13px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: var(--samta-green);
    background: #ecf7f5;
    border: 1px solid #cfe7e3;
}

.samta-portal-card-copy {
    display: grid;
    gap: 7px;
}

.samta-portal-card-copy strong {
    font-size: 20px;
    font-weight: 950;
}

.samta-portal-card-copy small {
    color: var(--samta-muted);
    font-size: 12px;
    line-height: 1.7;
}

.samta-portal-card-action {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #98751f;
    background: #fff9e8;
    border: 1px solid #ead69b;
    font-size: 17px;
}

@media (max-width: 782px) {
    body.admin-bar {
        --samta-admin-offset: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .samta-tools-navigation {
        transition: none !important;
    }
}

/* 2.2.0 — شعار حقيقي بأقصى اليمين وقائمة بأقصى اليسار. */
.samta-tools-header-inner {
    width: 100%;
    max-width: none;
    min-height: 58px;
    margin: 0;
    padding: 5px max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left));
    justify-content: space-between;
    gap: 12px;
}

.samta-tools-brand {
    order: 1;
    flex: 0 1 auto;
    max-width: calc(100% - 104px);
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.samta-tools-brand-logo {
    display: block;
    width: auto;
    height: clamp(38px, 8vw, 50px);
    max-width: 100%;
    object-fit: contain;
    object-position: right center;
}

.samta-tools-brand-mark,
.samta-tools-brand-copy {
    display: none !important;
}

.samta-tools-menu-button {
    order: 2;
    flex: 0 0 auto;
    margin: 0;
    margin-inline-start: 0;
    min-width: 88px;
    min-height: 42px;
    justify-content: center;
}

.samta-tools-navigation {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
}

@media (max-width: 420px) {
    .samta-tools-header-inner {
        min-height: 54px;
        gap: 8px;
    }

    .samta-tools-brand {
        max-width: calc(100% - 78px);
    }

    .samta-tools-brand-logo {
        height: 39px;
    }

    .samta-tools-menu-button {
        min-width: 50px;
        width: 50px;
        padding: 8px;
    }

    .samta-tools-menu-button-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}


/* 2.2.1 — عرض الشعار الكامل PNG من دون أي اقتصاص. */
.samta-tools-header-inner {
    min-height: 72px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.samta-tools-brand {
    overflow: visible;
    max-width: calc(100% - 112px);
}

.samta-tools-brand-logo {
    width: auto;
    height: clamp(54px, 7vw, 64px);
    max-width: 100%;
    object-fit: contain;
    object-position: right center;
}

@media (max-width: 520px) {
    .samta-tools-header-inner {
        min-height: 62px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .samta-tools-brand {
        max-width: calc(100% - 68px);
    }

    .samta-tools-brand-logo {
        height: 50px;
    }
}

@media (max-width: 360px) {
    .samta-tools-brand-logo {
        height: 45px;
    }
}


@media (max-width: 480px) {
    .samta-tool-title-banner {
        min-height: 50px;
        padding: 10px 12px;
        gap: 8px;
        border-radius: 15px;
    }

    .samta-tool-title-banner-text {
        white-space: normal;
    }
}

/* 2.3.0 — منصة نماء التعليمية ضمن الأدوات. */
.samta-portal-card-nama .samta-portal-card-icon {
    color: #168f63;
    background: #edf9f3;
    border-color: #ccebdc;
}

.samta-portal-card-nama:hover,
.samta-portal-card-nama:focus-visible {
    border-color: #a9dac4;
    box-shadow: 0 18px 45px rgba(22, 143, 99, .12);
}


/* 2.4.0 — مولّد الجدول المدرسي. */
.samta-portal-card-schedule .samta-portal-card-icon {
    color: #0b6f86;
    background: #edf8fb;
    border-color: #c8e5ec;
}

.samta-portal-card-schedule:hover,
.samta-portal-card-schedule:focus-visible {
    border-color: #9fd1dc;
    box-shadow: 0 18px 45px rgba(11, 111, 134, .12);
}

/* 2.5.0 — تحليل النتائج ونماء التعلم كأداة مستقلة عن نماء القديمة. */
.samta-portal-card-results .samta-portal-card-icon {
    color: #6750a4;
    background: #f4f0fb;
    border-color: #ded4f1;
}

.samta-portal-card-results:hover,
.samta-portal-card-results:focus-visible {
    border-color: #c4b2e4;
    box-shadow: 0 18px 45px rgba(103, 80, 164, .13);
}

/* 2.6.0 — موثّق استراتيجيات التدريس. */
.samta-portal-card-teaching-strategy .samta-portal-card-icon {
    color: #a66b16;
    background: #fff8e9;
    border-color: #eed9aa;
}

.samta-portal-card-teaching-strategy:hover,
.samta-portal-card-teaching-strategy:focus-visible {
    border-color: #dfbe78;
    box-shadow: 0 18px 45px rgba(166, 107, 22, .13);
}
