/* هوية جمعية ثمرة التعليمية — ألوان هادئة مستوحاة من الشعار */

/* خط Cairo مستضاف محلياً، مع Tahoma و Segoe UI و Arial كخطوط احتياطية */
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/cairo-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/cairo-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/cairo-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/cairo-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cairo"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/cairo-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --brand: #6b6846;
  --brand-dark: #4f4c33;
  --brand-soft: #efede4;
  --accent: #a39a76;
  --bg: #f8f7f3;
  --card: #ffffff;
  --text: #2e2d27;
  --muted: #7a776b;
  --border: #e4e1d6;
  --danger: #a23b2e;
  --danger-soft: #f6e6e3;
  --ok-soft: #ecebdf;
  --warn-soft: #f4eedc;
  --radius: 10px;
  font-family: "Cairo", Tahoma, "Segoe UI", Arial, sans-serif;
}
html.dark {
  --brand: #a8a37c;
  --brand-dark: #c4bf98;
  --brand-soft: #2c2b23;
  --accent: #8d8664;
  --bg: #1b1b18;
  --card: #24241f;
  --text: #ebe9e1;
  --muted: #a3a092;
  --border: #38372f;
  --danger: #d9796c;
  --danger-soft: #3a2623;
  --ok-soft: #2e2d24;
  --warn-soft: #34301f;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
a { color: var(--brand); text-decoration: none; }
.muted { color: var(--muted); font-size: .85rem; margin: .2rem 0 0; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; width: 100%; }
[hidden] { display: none !important; }

/* الأزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 8px; padding: .55rem 1.1rem; font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; background: var(--card); color: var(--text); }
.btn.primary { background: var(--brand); color: #fff; }
html.dark .btn.primary { color: #1b1b18; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.dark { background: #3a3929; color: #fff; }
.btn.outline { border-color: var(--border); background: transparent; color: inherit; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: .35rem .7rem; font-size: .8rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }
.link { background: none; border: 0; color: var(--brand); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; padding: 0; }
.link.danger { color: var(--danger); }
.icon-btn { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; width: 38px; height: 38px; border-radius: 8px; cursor: pointer; }
.mini { border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 6px; padding: .3rem .55rem; cursor: pointer; font-size: .8rem; }
.mini:hover { border-color: var(--brand); color: var(--brand); }
.mini.danger:hover { border-color: var(--danger); color: var(--danger); }

/* الترويسة */
.topbar { background: var(--brand-dark); color: #fff; position: sticky; top: 0; z-index: 40; }
html.dark .topbar { background: #2a2920; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; font-weight: 700; font-size: 1.05rem; }
.brand img { width: 42px; height: 42px; border-radius: 8px; background: #fff; object-fit: contain; }
.topbar-tools { display: flex; align-items: center; gap: .6rem; }
.topbar-tools form { margin: 0; }
.topbar .btn.outline { border-color: rgba(255,255,255,.35); color: #fff; }
.user-chip { display: flex; flex-direction: column; line-height: 1.25; font-size: .82rem; text-align: right; }
.user-chip small { opacity: .75; }

/* التخطيط */
.layout { display: flex; gap: 20px; padding-top: 20px; padding-bottom: 20px; flex: 1; }
.sidebar { width: 240px; flex-shrink: 0; }
.main { flex: 1; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; position: sticky; top: 84px; }
.nav-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 8px; color: var(--text); font-size: .9rem; font-weight: 600; }
.nav-item i { width: 18px; text-align: center; color: var(--muted); }
.nav-item:hover { background: var(--brand-soft); }
.nav-item.active { background: var(--brand); color: #fff; }
html.dark .nav-item.active { color: #1b1b18; }
.nav-item.active i { color: inherit; }
.nav-item .badge { margin-inline-start: auto; }
.badge { background: var(--brand-soft); color: var(--brand-dark); font-size: .72rem; font-weight: 700; padding: 0 .5rem; border-radius: 99px; min-width: 22px; text-align: center; }
.nav-item.active .badge { background: rgba(255,255,255,.25); color: inherit; }
.view { display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-gap { display: flex; gap: .5rem; flex-wrap: wrap; }
.page-head, .welcome { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.welcome { border-inline-start: 4px solid var(--brand); }
.card-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.pill { background: var(--brand-soft); color: var(--brand-dark); padding: .3rem .9rem; border-radius: 99px; font-size: .8rem; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.span-2 { grid-column: span 2; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.empty { text-align: center; color: var(--muted); padding: 2rem 0; }

/* المؤشرات */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 1.8rem; color: var(--brand-dark); margin: .2rem 0; }
.kpi small { font-size: .75rem; color: var(--muted); }
.chart-box { height: 250px; position: relative; }

/* الجداول */
.table-wrap { overflow-x: auto; }
.scroll-y { max-height: 420px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: right; background: var(--brand-soft); color: var(--brand-dark); padding: .65rem; font-weight: 700; white-space: nowrap; }
td { padding: .65rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(107,104,70,.04); }
td.mono, .mono { font-family: Consolas, monospace; direction: ltr; unicode-bidi: embed; }
td.trunc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: .3rem; justify-content: center; }
.tag { display: inline-block; padding: .1rem .55rem; border-radius: 6px; font-size: .75rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); }
.tag.ok { background: var(--ok-soft); color: var(--brand-dark); border: 1px solid var(--accent); }
.tag.warn { background: var(--warn-soft); color: #8a6d22; }
html.dark .tag.warn { color: #d8bf78; }
.tag.bad { background: var(--danger-soft); color: var(--danger); }

/* شريط الأدوات */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px; }
.toolbar input, .toolbar select { flex: 1; min-width: 200px; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--border); background: var(--card); color: var(--text); padding: .4rem .9rem; border-radius: 8px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.seg button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
html.dark .seg button.active { color: #1b1b18; }

/* النماذج */
input, select, textarea { width: 100%; font: inherit; font-size: .9rem; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--brand); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .83rem; font-weight: 700; }
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-row img { width: 90px; height: 90px; object-fit: contain; border: 1px dashed var(--border); border-radius: 10px; background: #fff; padding: 4px; }
.logo-row > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* النوافذ */
.modal { position: fixed; inset: 0; background: rgba(30,29,22,.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-box { background: var(--card); border-radius: 12px; width: 100%; max-width: 560px; padding: 20px; border-top: 4px solid var(--brand); }
.modal-box.sm { max-width: 440px; }
.modal-box.lg { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.x { background: none; border: 0; font-size: 1.5rem; color: var(--muted); cursor: pointer; line-height: 1; }
#confirmModal { z-index: 200; align-items: center; }
#confirmModal p { margin: .6rem 0 1rem; font-size: .9rem; }

/* الإشعارات */
.toasts { position: fixed; top: 16px; left: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast { background: #2e2d27; color: #fff; padding: .7rem 1rem; border-radius: 8px; font-size: .86rem; border-inline-start: 4px solid var(--accent); }
.toast.error { border-color: #d9796c; }
.toast.warn { border-color: #d8bf78; }

/* الحضور */
.geo-state { display: inline-block; padding: .5rem 1rem; border-radius: 99px; font-weight: 700; font-size: .85rem; background: var(--brand-soft); color: var(--brand-dark); margin-bottom: 14px; }
.geo-state.in { background: var(--ok-soft); border: 1px solid var(--accent); }
.geo-state.out { background: var(--danger-soft); color: var(--danger); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; text-align: right; font-size: .85rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 0 0 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; text-align: left; }

/* المتابعة */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.col { background: var(--brand-soft); border-radius: var(--radius); padding: 10px; }
.col-head { display: flex; justify-content: space-between; font-weight: 700; font-size: .88rem; padding: 4px 4px 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 240px; }
.k-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: .84rem; }
.k-card h4 { margin: 0; font-size: .9rem; }
.k-card select { padding: .2rem .4rem; font-size: .78rem; width: auto; }
.k-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; }
input[type=range] { padding: 0; accent-color: var(--brand); background: none; border: 0; }

/* المحاضر والمهام */
.list-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--bg); }
.list-item:hover, .list-item.active { border-color: var(--brand); }
.list-item h4 { margin: 2px 0; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--bg); border-radius: 8px; padding: 12px; margin: 14px 0; font-size: .86rem; }
.meta .full { grid-column: span 2; }
.decisions { white-space: pre-line; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px; font-size: .9rem; }
.sign-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.sign-row img { height: 50px; background: #fff; }
.task { display: flex; flex-direction: column; gap: 10px; }
.task.done { opacity: .7; }
.task.done h4 { text-decoration: line-through; }
.task h4 { margin: 0; font-size: .92rem; }
.task-foot { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.approval { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-inline-start: 4px solid var(--accent); }
.approval h4 { margin: 4px 0; }
.timeline { list-style: none; margin: 0; padding: 0 14px 0 0; border-right: 2px solid var(--border); max-height: 340px; overflow-y: auto; }
.timeline li { position: relative; padding: 0 12px 14px 0; }
.timeline li::before { content: ""; position: absolute; right: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline small { color: var(--muted); display: block; }
.sig-head { display: flex; justify-content: space-between; font-size: .83rem; font-weight: 700; }
.sig-pad { width: 100%; height: 130px; background: #fff; border: 1px solid var(--border); border-radius: 8px; touch-action: none; cursor: crosshair; }
.report { display: flex; flex-direction: column; gap: 10px; justify-content: space-between; }

/* صفحة الدخول */
.auth-page { align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.auth-card { background: var(--card); border: 1px solid var(--border); border-top: 4px solid var(--brand); border-radius: 14px; padding: 28px; width: 100%; max-width: 420px; text-align: center; }
.auth-card .form { text-align: right; margin-top: 18px; }
.auth-logo { width: 130px; height: 130px; object-fit: contain; }
.auth-title { font-size: 1.3rem; color: var(--brand-dark); }
.auth-sub { color: var(--muted); margin: .2rem 0 0; font-size: .85rem; }
.alert { padding: .6rem .8rem; border-radius: 8px; font-size: .85rem; margin-top: 12px; text-align: right; }
.alert.err { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); }

.footer { background: var(--card); border-top: 1px solid var(--border); padding: 12px 0; font-size: .82rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.show-md { display: none; }

@media (max-width: 1024px) {
  .show-md { display: inline-block; }
  .sidebar { position: fixed; top: 64px; right: 0; bottom: 0; width: 260px; z-index: 50; padding: 10px; background: var(--bg); box-shadow: -4px 0 16px rgba(0,0,0,.12); transform: translateX(110%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .nav { position: static; }
  .kanban { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .grid-3, .grid-2, .kpis, .kanban { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: auto; }
  .user-chip, .hide-sm { display: none; }
  .brand span { font-size: .9rem; }
}

/* ===== الطباعة A4 ===== */
#printArea { display: none; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff; color: #000; display: block; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; font-size: 12pt; direction: rtl; font-family: "Cairo", Tahoma, "Segoe UI", Arial, sans-serif; }
}
.p-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #4f4c33; padding-bottom: 12px; margin-bottom: 18px; }
.p-header h2 { margin: 0; font-size: 18pt; color: #4f4c33; }
.p-header p { margin: 4px 0 0; font-size: 10pt; color: #555; }
.p-header img { height: 70px; max-width: 140px; object-fit: contain; }
.p-title { text-align: center; font-size: 14pt; margin: 0 0 16px; }
.p-sub { text-align: center; color: #555; font-size: 10pt; margin: -10px 0 16px; }
.p-table { width: 100%; border-collapse: collapse; font-size: 10.5pt; margin-bottom: 20px; }
.p-table th, .p-table td { border: 1px solid #999; padding: 7px; text-align: right; }
.p-table th { background: #efede4; color: #000; }
.p-box { border: 1px solid #999; border-radius: 6px; padding: 12px; white-space: pre-line; line-height: 1.8; margin-bottom: 30px; }
.p-info { background: #f6f5f0; border: 1px solid #ccc; padding: 10px; border-radius: 6px; margin-bottom: 16px; }
.p-info p { margin: 0 0 4px; }
.p-signs { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 50px; padding: 0 30px; text-align: center; }
.p-signs b { display: block; margin-bottom: 40px; }
.p-signs img { height: 50px; display: block; margin: 0 auto 4px; }
.p-stamp { width: 110px; height: 110px; border: 2px dashed #999; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #999; font-size: 9pt; }

/* ===== الصفحة التعريفية العامة ===== */
.site { display: block; }
.site-nav { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.site-nav-inner { display: flex; justify-content: space-between; align-items: center; height: 70px; gap: 12px; }
.site-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--brand-dark); }
.site-brand img { height: 46px; width: auto; }
.site-links { display: flex; align-items: center; gap: 1.2rem; font-weight: 600; font-size: .92rem; }
.site-links a:not(.btn) { color: var(--text); }
.site-links a:not(.btn):hover { color: var(--brand); }
.hero { background: var(--brand-soft); border-bottom: 1px solid var(--border); padding: 70px 0 64px; text-align: center; }
.hero-logo { width: 190px; max-width: 60%; background: #fff; border-radius: 16px; padding: 10px; border: 1px solid var(--border); }
.hero h1 { font-size: 2rem; color: var(--brand-dark); margin-top: 18px; }
.hero p { color: var(--muted); font-size: 1.05rem; margin: .5rem auto 0; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.site-section { padding: 64px 0; }
.site-section.alt { background: var(--card); border-top: 1px solid var(--border); }
.narrow { max-width: 820px; text-align: center; }
.eyebrow { display: inline-block; color: var(--brand); font-weight: 700; font-size: .85rem; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.section-title { font-size: 1.6rem; margin: 10px 0 24px; color: var(--brand-dark); }
.mission { margin: 0; font-size: 1.15rem; line-height: 2.1; background: var(--card); border: 1px solid var(--border); border-inline-start: 5px solid var(--brand); border-radius: 12px; padding: 28px 30px; text-align: right; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 20px; align-items: start; }
.contact-list { display: flex; flex-direction: column; gap: 12px; }
.contact-item { display: flex; align-items: center; gap: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; color: var(--text); }
.contact-item:hover { border-color: var(--brand); }
.contact-item i { width: 42px; height: 42px; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.contact-item small { display: block; color: var(--muted); font-size: .8rem; }
.contact-item b { font-size: .95rem; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.auth-back { display: inline-block; margin-top: 16px; font-size: .85rem; font-weight: 600; }
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
  .site-brand span { display: none; }
  .site-links { gap: .8rem; font-size: .85rem; }
  .hero h1 { font-size: 1.5rem; }
  .mission { font-size: 1rem; padding: 20px; }
}

/* ===== حركات الصفحة التعريفية ===== */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--brand-soft), var(--bg)); }
.hero-inner { position: relative; z-index: 1; }
.hero-shape { position: absolute; border-radius: 50%; border: 2px solid var(--accent); opacity: .18; animation: drift 14s ease-in-out infinite; }
.hero-shape.s1 { width: 260px; height: 260px; top: -80px; right: -60px; }
.hero-shape.s2 { width: 160px; height: 160px; bottom: -50px; left: 8%; animation-delay: -5s; background: var(--accent); opacity: .08; border: 0; }
.hero-shape.s3 { width: 90px; height: 90px; top: 30%; left: 18%; animation-delay: -9s; }
@keyframes drift { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(18px,-22px) rotate(25deg); } }

.logo-stage { position: relative; display: inline-block; animation: logoIn 1.1s cubic-bezier(.2,.8,.2,1) both; }
.logo-stage .hero-logo { position: relative; z-index: 1; animation: float 5s ease-in-out 1.1s infinite; box-shadow: 0 14px 34px rgba(79,76,51,.16); }
.logo-ring { position: absolute; inset: -14px; border-radius: 26px; border: 2px solid var(--accent); opacity: 0; animation: ring 3.2s ease-out 1.2s infinite; }
.logo-ring.r2 { animation-delay: 2.8s; }
@keyframes logoIn { 0% { opacity: 0; transform: scale(.6) rotate(-8deg); filter: blur(6px); } 70% { transform: scale(1.05) rotate(1deg); filter: blur(0); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes ring { 0% { opacity: .55; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.25); } }

.rise { opacity: 0; animation: rise .8s ease-out both; }
.rise.d1 { animation-delay: .5s; } .rise.d2 { animation-delay: .7s; } .rise.d3 { animation-delay: .9s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.show { opacity: 1; transform: none; }

.hero-actions .btn { transition: transform .2s, box-shadow .2s; }
.hero-actions .btn:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(79,76,51,.18); }
.contact-item { transition: transform .2s, border-color .2s, box-shadow .2s; }
.contact-item:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(79,76,51,.10); }
.contact-item i { transition: transform .3s; }
.contact-item:hover i { transform: rotate(-10deg) scale(1.08); }
.mission { position: relative; }
.site-brand img { transition: transform .4s; }
.site-brand:hover img { transform: rotate(-6deg) scale(1.06); }

.credit { text-align: center; font-size: .75rem; color: var(--muted); padding-top: 8px; margin-top: 8px; border-top: 1px dashed var(--border); display: flex; justify-content: center; align-items: center; gap: .5rem; flex-wrap: wrap; }
.credit .wa { display: inline-flex; align-items: center; gap: .3rem; color: #1f9d55; font-weight: 700; }
.credit .wa i { font-size: 1rem; }
.credit .wa:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .hero-shape, .logo-stage, .logo-stage .hero-logo, .logo-ring, .rise { animation: none !important; opacity: 1; }
  .logo-ring { opacity: 0; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
.logo-stage .hero-logo { display: block; width: 190px; max-width: none; }
@media (max-width: 760px) { .logo-stage .hero-logo { width: 150px; } }

/* ===== الواجهة: الشعار والصور جنباً إلى جنب ===== */
.hero { padding: 60px 0; text-align: right; }
.hero-split { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; }
.hero-text h1 { margin-top: 22px; font-size: 2.2rem; }
.hero-text p { margin: .6rem 0 0; max-width: 520px; line-height: 1.9; color: var(--text); opacity: .8; }
.hero-text .hero-actions { justify-content: flex-start; }
.hero-text .logo-stage .hero-logo { width: 160px; }

.hero-media { position: relative; animation: photoIn 1.2s cubic-bezier(.2,.8,.2,1) .3s both; }
.hero-photo { position: relative; z-index: 1; display: block; width: 100%; height: auto; border-radius: 18px; border: 6px solid var(--card); box-shadow: 0 24px 50px rgba(79,76,51,.25); transform: rotate(-1.5deg); transition: transform .5s; }
.hero-media:hover .hero-photo { transform: rotate(0) scale(1.02); }
.media-frame { position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--accent); border-radius: 20px; opacity: .6; animation: frameFloat 6s ease-in-out infinite; }
.media-badge { position: absolute; z-index: 2; bottom: -16px; right: 24px; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; padding: .55rem 1rem; border-radius: 99px; box-shadow: 0 10px 22px rgba(79,76,51,.3); animation: float 4.5s ease-in-out 1.5s infinite; }
html.dark .media-badge { color: #1b1b18; }
@keyframes photoIn { from { opacity: 0; transform: translateX(-60px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes frameFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-8px,8px); } }

.mt-lg { margin-top: 56px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.fact { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; text-align: center; transition: transform .25s, box-shadow .25s, border-color .25s; }
.fact:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 14px 30px rgba(79,76,51,.12); }
.fact i { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 12px; transition: transform .4s, background .3s, color .3s; }
.fact:hover i { background: var(--brand); color: #fff; transform: rotate(-8deg) scale(1.08); }
.fact h3 { font-size: 1.05rem; color: var(--brand-dark); margin-bottom: 6px; }
.fact p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.9; }

@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; gap: 40px; }
  .hero-text { align-items: center; text-align: center; }
  .hero-text .hero-actions { justify-content: center; }
  .hero-text .logo-stage .hero-logo { width: 140px; }
  .facts { grid-template-columns: 1fr; }
  .media-frame { inset: 12px -10px -12px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media, .media-frame, .media-badge { animation: none !important; }
}

/* ===== إطارات الهوية + الرؤية والرسالة ===== */
:root { --frame: linear-gradient(135deg, #8a7f52, #c9b98a 45%, #6b6846); --gold: #b59f6a; }
html.dark { --frame: linear-gradient(135deg, #8d8664, #d6c79a 45%, #a8a37c); --gold: #cbb784; }

/* إطار متدرج حول البطاقات */
.fact, .contact-item, .form-card, .vm-card, .goal, .mission {
  border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--frame) border-box;
}
.contact-item { background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--frame) border-box; }
.form-card { border-radius: 16px; box-shadow: 0 16px 36px rgba(79,76,51,.10); position: relative; }
.form-card::before { content: ""; position: absolute; top: 0; right: 24px; left: 24px; height: 4px; background: var(--frame); border-radius: 0 0 6px 6px; }
.fact { position: relative; overflow: hidden; }
.fact::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--frame); transform: scaleX(0); transition: transform .4s; }
.fact:hover::after { transform: scaleX(1); }
.fact:hover, .contact-item:hover { border-color: transparent; }

/* عنوان بخطوط جانبية */
.title-lines { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 30px; }
.title-lines h2 { font-size: 1.7rem; color: var(--gold); white-space: nowrap; }
.title-lines::before, .title-lines::after { content: ""; flex: 0 1 150px; height: 6px; border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); opacity: .7; }
.site-section.alt-soft { background: var(--brand-soft); border-top: 1px solid var(--border); }

.vm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.vm-card { border-radius: 18px; padding: 26px; position: relative; overflow: hidden; transition: transform .3s, box-shadow .3s; }
.vm-card::before { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: var(--brand-soft); top: -60px; left: -60px; transition: transform .5s; }
.vm-card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(79,76,51,.14); }
.vm-card:hover::before { transform: scale(1.3); }
.vm-head { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.vm-head i { width: 46px; height: 46px; border-radius: 12px; background: var(--frame); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.vm-head h3 { font-size: 1.25rem; color: var(--brand-dark); }
.vm-card p { position: relative; margin: 0; line-height: 2; font-size: 1rem; }

.goals-box { margin-top: 24px; position: relative; border-radius: 18px; padding: 44px 22px 22px; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--frame) border-box; border: 2px solid transparent; }
.goals-tag { position: absolute; top: -1px; right: 26px; background: var(--brand); color: #fff; font-weight: 700; padding: .45rem 1.2rem; border-radius: 0 0 12px 12px; font-size: .92rem; }
html.dark .goals-tag { color: #1b1b18; }
.goals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.goal { border-radius: 40px 14px 40px 14px; padding: 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; transition: transform .3s, box-shadow .3s; }
.goal:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 12px 26px rgba(79,76,51,.14); }
.goal i { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--gold); color: var(--brand); background: var(--card); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: background .3s, color .3s; }
.goal:hover i { background: var(--brand); color: #fff; }
.goal p { margin: 0; font-weight: 700; font-size: .92rem; line-height: 1.8; }

/* زر دخول المنسوبين */
.login-cta { display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.4rem; border-radius: 12px; background: var(--frame); color: #fff !important; font-weight: 800; font-size: 1rem; box-shadow: 0 8px 20px rgba(79,76,51,.28); position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.login-cta i { font-size: 1.2rem; }
.login-cta::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); animation: shine 3.5s ease-in-out infinite; }
.login-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(79,76,51,.35); }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }

@media (max-width: 900px) {
  .vm-grid { grid-template-columns: 1fr; }
  .goals { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .site-links a:not(.login-cta) { display: none; }
  .login-cta { padding: .6rem 1rem; font-size: .92rem; }
  .goals { grid-template-columns: 1fr; }
  .title-lines h2 { font-size: 1.25rem; }
  .title-lines::before, .title-lines::after { flex-basis: 40px; }
}
@media (prefers-reduced-motion: reduce) { .login-cta::after { animation: none; display: none; } }
