/* Felah v4.3.2 — Home: Reference Top + Large Categories Only */

:root{
  --bg:#f3f0e6;
  --card:#ffffff;
  --soft:#edf3eb;
  --soft2:#e8efe4;
  --line:#d8cbb7;
  --line2:#c5b28f;
  --text:#10291b;
  --muted:#657468;
  --green:#0f5f38;
  --green2:#167544;
  --radius:12px;
  --font:"IBM Plex Sans Arabic",Tahoma,Arial,sans-serif;
}

html[data-theme="dark"]{
  --bg:#041d12;
  --card:#062416;
  --soft:#082a1a;
  --soft2:#0a301f;
  --line:rgba(232,248,235,.16);
  --line2:rgba(232,248,235,.28);
  --text:#edf7ef;
  --muted:rgba(237,247,239,.68);
  --green:#eaf5ed;
  --green2:#b8e0c5;
}

*{box-sizing:border-box}

html,body{
  margin:0!important;
  padding:0!important;
  direction:rtl!important;
  text-align:right!important;
  background:var(--bg)!important;
  color:var(--text)!important;
  font-family:var(--font)!important;
  font-size:14px;
  line-height:1.75;
}

a{
  color:inherit;
  text-decoration:none;
}

body.felah-reference-home .public-header,
body.felah-reference-home .felah-real-topbar,
body.felah-reference-home .felah-real-tabs,
body.felah-reference-home .felah-main-tabs,
body.felah-reference-home .felah-nav,
body.felah-reference-home .felah-quick-nav,
body.felah-reference-home .felah-main-banner,
body.felah-reference-home .felah-home-shortcuts,
body.felah-reference-home .home-grid,
body.felah-reference-home .home-panel,
body.felah-reference-home .felah-home-grid,
body.felah-reference-home .felah-home-box{
  display:none!important;
}

body.felah-reference-home .container{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
}

/* الصفحة */
.felah-ref-page{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(0,1fr) 132px;
  grid-template-areas:"main sidebar";
  direction:ltr;
  background:var(--bg);
}

.felah-ref-main{
  grid-area:main;
  direction:rtl;
  min-width:0;
  padding:0 8px 8px;
}

.felah-ref-sidebar{
  grid-area:sidebar;
  direction:rtl;
  position:sticky;
  top:0;
  height:100vh;
  background:var(--card);
  border-left:1px solid var(--line);
  padding:8px;
  overflow:auto;
}

/* القائمة اليمنى */
.felah-ref-login{
  height:44px;
  border-radius:10px;
  background:var(--green2);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  margin-bottom:8px;
}

.felah-ref-logo-box{
  min-height:122px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--soft);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center!important;
  padding:10px 8px;
  margin-bottom:10px;
}

.felah-ref-logo-box .logo-main{
  font-size:21px;
  font-weight:900;
  line-height:1.45;
}

.felah-ref-logo-box .logo-sub{
  font-size:11px;
  color:var(--muted);
  line-height:1.5;
}

.felah-ref-user{
  border:1px solid #f0c8c8;
  background:#fff6f6;
  color:#9c2f2f;
  border-radius:8px;
  padding:7px 5px;
  text-align:center!important;
  font-size:11px;
  line-height:1.5;
  margin-bottom:10px;
}

html[data-theme="dark"] .felah-ref-user{
  background:#331c1c;
  color:#ffd2d2;
  border-color:#5a3535;
}

.felah-ref-side-title{
  text-align:center!important;
  font-weight:900;
  font-size:13px;
  margin:10px 0 8px;
}

.felah-ref-side-nav{
  display:grid;
  gap:5px;
}

.felah-ref-side-nav a{
  min-height:34px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:5px;
  font-size:12px;
  font-weight:800;
  color:var(--text);
  text-align:center!important;
  white-space:nowrap;
}

.felah-ref-side-nav a:hover,
.felah-ref-side-nav a.active{
  background:var(--soft);
  color:var(--green);
}

/* الرأس */
.felah-ref-topbar{
  height:38px;
  display:grid;
  grid-template-columns:auto auto auto minmax(180px,1fr);
  gap:8px;
  align-items:center;
  padding:5px 0;
  background:var(--bg);
}

.felah-ref-account{
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--card);
  font-size:11px;
  color:#b44;
  cursor:pointer;
}

.felah-ref-mini-btn{
  width:28px;
  height:28px;
  border:1px solid var(--line);
  border-radius:50%;
  background:var(--card);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:var(--text);
  font-size:11px;
}

.felah-ref-search{
  height:28px;
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--card);
  padding:0 8px;
}

.felah-ref-search input{
  border:0!important;
  outline:0!important;
  background:transparent!important;
  width:100%!important;
  color:var(--text)!important;
  font-family:var(--font)!important;
  font-size:11px!important;
  text-align:right!important;
  direction:rtl!important;
}

/* أعلى الواجهة كما في النموذج */
.felah-ref-hero{
  min-height:86px;
  border-radius:10px 10px 0 0;
  background:var(--soft);
  border:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center!important;
  padding:14px;
}

.felah-ref-hero h1{
  margin:0;
  font-size:20px;
  line-height:1.55;
  font-weight:900;
}

.felah-ref-hero p{
  margin:3px 0 0;
  font-size:14px;
  font-weight:800;
}

.felah-ref-ads{
  display:grid;
  grid-template-columns:1fr 1fr;
}

.felah-ref-ad{
  height:78px;
  background:var(--card);
  border:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center!important;
  font-weight:800;
  font-size:15px;
}

.felah-ref-ad:first-child{
  border-left:0;
}

.felah-ref-ad:last-child{
  border-right:0;
}

/* منطقة الأقسام فقط */
.felah-categories-stage{
  border:1px solid var(--line2);
  border-top:0;
  background:var(--card);
  border-radius:0 0 12px 12px;
  min-height:470px;
  padding:44px 48px 34px;
}

.felah-categories-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:30px;
}

.felah-categories-title h2{
  margin:0;
  font-size:38px;
  line-height:1.25;
  font-weight:900;
  color:var(--text);
}

.felah-categories-title p{
  margin:8px 0 0;
  color:var(--muted);
  font-size:14px;
}

.felah-all-categories-btn{
  min-width:88px;
  min-height:76px;
  border-radius:18px;
  background:var(--soft);
  border:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center!important;
  font-size:15px;
  line-height:1.5;
  font-weight:900;
}

.felah-category-large-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:22px;
}

.felah-category-large-card{
  min-height:176px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:24px;
  padding:30px 34px;
  display:grid;
  grid-template-columns:100px minmax(0,1fr);
  gap:28px;
  align-items:center;
}

.felah-category-icon{
  width:96px;
  height:96px;
  border-radius:24px;
  background:var(--soft);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--green2);
  font-size:32px;
}

.felah-category-content h3{
  margin:0 0 10px;
  font-size:34px;
  line-height:1.25;
  color:var(--text);
  font-weight:900;
}

.felah-category-content p{
  margin:0 0 16px;
  color:var(--muted);
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.felah-category-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.felah-category-meta span{
  min-height:34px;
  padding:0 18px;
  border-radius:999px;
  background:var(--soft);
  color:var(--text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  font-weight:900;
}

.felah-ref-bottom{
  height:42px;
  margin-top:6px;
  border-radius:8px;
  background:var(--soft);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  border:1px solid var(--line);
}

.felah-ref-float{
  position:fixed;
  right:142px;
  bottom:10px;
  width:178px;
  min-height:72px;
  background:linear-gradient(180deg,#136b40,#0c482d);
  color:white;
  border-radius:9px;
  padding:10px;
  font-size:10px;
  z-index:30;
}

.felah-ref-float strong{
  display:block;
  margin-bottom:4px;
}

.felah-ref-float span{
  display:inline-flex;
  margin-top:6px;
  padding:2px 8px;
  background:rgba(255,255,255,.18);
  border-radius:999px;
}

/* قائمة المستخدم */
.felah-ref-account-menu{
  position:relative;
}

.felah-ref-dropdown{
  display:none;
  position:absolute;
  top:32px;
  right:0;
  min-width:150px;
  padding:5px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:7px;
  z-index:80;
}

.felah-ref-account-menu.open .felah-ref-dropdown{
  display:grid;
  gap:3px;
}

.felah-ref-dropdown a{
  padding:6px;
  border-radius:4px;
  font-size:11px;
}

.felah-ref-dropdown a:hover{
  background:var(--soft);
}

.felah-ref-mobile-nav{
  display:none;
}

/* الهاتف: إزالة الصف الزائد، عرض طبيعي فقط */
@media(max-width:900px){
  html[data-theme="light"]{
    --bg:#031b11;
    --card:#062416;
    --soft:#082a1a;
    --soft2:#0a301f;
    --line:rgba(232,248,235,.16);
    --line2:rgba(232,248,235,.28);
    --text:#edf7ef;
    --muted:rgba(237,247,239,.68);
    --green:#eaf5ed;
    --green2:#b8e0c5;
  }

  html,body{
    background:#031b11!important;
    color:#edf7ef!important;
  }

  .felah-ref-page{
    display:block;
    min-height:100vh;
    padding-bottom:96px;
    background:#031b11;
  }

  .felah-ref-sidebar,
  .felah-ref-float,
  .felah-mobile-extra-row,
  .felah-mobile-brand-row,
  .felah-ref-mobile-brand,
  .felah-ref-extra-actions,
  .felah-ref-mobile-title-buttons{
    display:none!important;
  }

  .felah-ref-main{
    padding:16px;
  }

  .felah-ref-topbar{
    height:auto;
    display:grid;
    grid-template-columns:auto auto 1fr;
    gap:10px;
    padding:0;
    margin-bottom:14px;
    border:0;
  }

  .felah-ref-account{
    height:52px;
    border-radius:18px;
    background:#082416;
    color:#edf7ef;
    border:1px solid rgba(232,248,235,.16);
    font-size:14px;
    padding:0 14px;
  }

  .felah-ref-mini-btn{
    width:52px;
    height:52px;
    border-radius:18px;
    background:#082416;
    color:#edf7ef;
    border:1px solid rgba(232,248,235,.16);
  }

  .felah-ref-search{
    grid-column:1 / -1;
    height:86px;
    border-radius:26px;
    background:#082416;
    border:1px solid rgba(232,248,235,.16);
    padding:0 22px;
  }

  .felah-ref-search input{
    font-size:22px!important;
    color:#edf7ef!important;
  }

  .felah-ref-hero{
    min-height:132px;
    border-radius:18px;
    background:#082416;
    border:1px solid rgba(232,248,235,.16);
    margin:0 0 10px;
  }

  .felah-ref-hero h1{
    font-size:23px;
    color:#edf7ef;
  }

  .felah-ref-hero p{
    font-size:17px;
    color:#edf7ef;
  }

  .felah-ref-ads{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }

  .felah-ref-ad,
  .felah-ref-ad:first-child,
  .felah-ref-ad:last-child{
    height:94px;
    border-radius:14px;
    border:1px solid rgba(232,248,235,.16);
    background:#062416;
    color:#edf7ef;
    font-size:18px;
  }

  .felah-categories-stage{
    border-radius:18px;
    border:1px solid rgba(232,248,235,.16);
    background:#062416;
    padding:22px 16px;
    min-height:auto;
    margin-top:12px;
  }

  .felah-categories-header{
    margin-bottom:16px;
  }

  .felah-categories-title h2{
    font-size:26px;
    color:#edf7ef;
  }

  .felah-categories-title p{
    color:rgba(237,247,239,.68);
  }

  .felah-all-categories-btn{
    display:none;
  }

  .felah-category-large-grid{
    grid-template-columns:1fr;
    gap:12px;
  }

  .felah-category-large-card{
    min-height:104px;
    border-radius:16px;
    background:#082a1a;
    border:1px solid rgba(232,248,235,.16);
    grid-template-columns:58px minmax(0,1fr);
    gap:14px;
    padding:16px;
  }

  .felah-category-icon{
    width:52px;
    height:52px;
    border-radius:14px;
    background:#eef5ef;
    color:#1c6841;
    font-size:20px;
  }

  .felah-category-content h3{
    font-size:20px;
    color:#edf7ef;
  }

  .felah-category-content p{
    font-size:13px;
    color:rgba(237,247,239,.68);
  }

  .felah-category-meta span{
    min-height:28px;
    padding:0 12px;
    font-size:12px;
    background:#0b321f;
    color:#edf7ef;
  }

  .felah-ref-bottom{
    display:none;
  }

  .felah-ref-mobile-nav{
    display:flex;
    position:fixed;
    right:14px;
    left:14px;
    bottom:14px;
    height:82px;
    border-radius:28px;
    background:#062416;
    border:1px solid rgba(232,248,235,.16);
    z-index:200;
    align-items:center;
    justify-content:space-around;
    box-shadow:0 14px 40px rgba(0,0,0,.18);
  }

  .felah-ref-mobile-nav a{
    flex:1;
    min-width:0;
    height:66px;
    border-radius:20px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    color:rgba(237,247,239,.68);
    font-size:13px;
    font-weight:900;
  }

  .felah-ref-mobile-nav a.active{
    background:#0b321f;
    color:#edf7ef;
  }

  .felah-ref-mobile-nav .ico{
    font-size:20px;
  }
}
