/* ===== Bill Plus Hub — الرموز والتصميم (مطابق للتوثيق) ===== */
@font-face{font-family:'IBM Plex Sans Arabic';src:url('/assets/fonts/IBMPlexSansArabic-Regular.ttf') format('truetype');font-weight:400 500 600;font-display:swap}
@font-face{font-family:'IBM Plex Sans Arabic';src:url('/assets/fonts/IBMPlexSansArabic-Bold.ttf') format('truetype');font-weight:700;font-display:swap}

:root{
  --bg:#F2F2F7; --surface:#FFFFFF; --surface2:#F6F7FA; --field:#EDEDF2;
  --stroke:#E1E5EC; --stroke2:#ECEEF3; --ink:#1C1C1E; --muted:#64708A; --muted2:#98A1B3;
  --primary:#3654DB; --brandInk:#3654DB; --accent:#1FAE83; --success:#1FAE83;
  --danger:#E05260; --warning:#D98E2E; --purple:#7C3AED;
  --shadow:0 1px 2px rgba(15,23,42,.04),0 1px 3px rgba(15,23,42,.06);
  --lift:0 14px 28px rgba(54,84,219,.22);
  --hero:linear-gradient(135deg,#2A5CA8 0%,#15347A 42%,#0B1F4E 72%,#0C2A2E 100%);
  --brandgrad:linear-gradient(90deg,#3654DB,#1FAE83);
}
:root[data-theme="dark"]{
  --bg:#0E1117; --surface:#171B24; --surface2:#1B202A; --field:#1F2430;
  --stroke:#2A303C; --stroke2:#232834; --ink:#EAEDF4; --muted:#98A3B8; --muted2:#6E788C;
  --brandInk:#8296F2; --purple:#A78BFA;
  --shadow:0 1px 3px rgba(0,0,0,.35);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0E1117; --surface:#171B24; --surface2:#1B202A; --field:#1F2430;
  --stroke:#2A303C; --stroke2:#232834; --ink:#EAEDF4; --muted:#98A3B8; --muted2:#6E788C;
  --brandInk:#8296F2; --purple:#A78BFA; --shadow:0 1px 3px rgba(0,0,0,.35);
}}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:'IBM Plex Sans Arabic',system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--ink);
  line-height:1.6;font-size:14px;-webkit-font-smoothing:antialiased;direction:rtl}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
.ltr{direction:ltr;unicode-bidi:isolate}

/* التخطيط العام */
.wrap{max-width:1480px;margin:0 auto;padding:18px;display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap}
.side{flex:0 0 250px;position:sticky;top:18px;max-height:calc(100vh - 36px);overflow-y:auto;
  background:var(--surface);border:1px solid var(--stroke);border-radius:20px;padding:16px;box-shadow:var(--shadow)}
.main{flex:1 1 640px;min-width:0;display:flex;flex-direction:column;gap:16px}

/* الشريط الجانبي */
.brand{display:flex;align-items:center;gap:11px;padding-bottom:14px;margin-bottom:8px;border-bottom:1px solid var(--stroke2)}
.brand img{width:46px;height:46px;border-radius:13px}
.brand .bt{font-size:15px;font-weight:700;direction:ltr}
.brand .bs{font-size:11.5px;color:var(--muted)}
.navsec{font-size:11px;font-weight:700;color:var(--muted2);padding:14px 12px 6px}
.nav{display:flex;flex-direction:column;gap:2px}
.nav a{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:11px;font-size:14px;font-weight:600;color:var(--ink)}
.nav a svg{width:18px;height:18px;flex:0 0 18px;color:var(--muted)}
.nav a:hover{background:var(--surface2)}
.nav a.on{background:color-mix(in srgb,var(--primary) 10%,var(--surface));color:var(--brandInk)}
.nav a.on svg{color:var(--brandInk)}
.nav .sp{flex:1}
.nav .cnt{background:var(--danger);color:#fff;font-size:11px;font-weight:700;min-height:20px;padding:0 7px;border-radius:999px;display:inline-flex;align-items:center}
.nav .lock{background:var(--field);color:var(--muted2);font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:999px}
.side-foot{margin-top:14px;padding-top:12px;border-top:1px solid var(--stroke2);display:flex;flex-direction:column;gap:10px}
.uchip{display:flex;align-items:center;gap:8px;background:var(--surface2);border:1px solid var(--stroke);border-radius:12px;padding:8px 10px;font-size:12px}
.dot{width:8px;height:8px;border-radius:999px;background:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 25%,transparent)}

/* الأزرار */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;cursor:pointer;
  font-family:inherit;font-weight:700;font-size:13.5px;border-radius:11px;padding:10px 16px;transition:.15s}
.btn-pri{background:var(--primary);color:#fff}
.btn-pri:hover{background:#2B46C2}
.btn-out{background:transparent;border:1px solid var(--stroke);color:var(--ink)}
.btn-out:hover{background:var(--surface2)}
.btn-sm{padding:7px 12px;font-size:12.5px;border-radius:9px}
.btn-block{width:100%}

/* الشريط العلوي */
.topbar{background:var(--surface);border:1px solid var(--stroke);border-radius:20px;padding:14px 18px;
  display:flex;align-items:center;gap:14px;box-shadow:var(--shadow)}
.topbar .tt{font-size:17px;font-weight:700}
.topbar .ts{font-size:12px;color:var(--muted)}
.topbar .sp{flex:1}
.searchpill{background:var(--field);border:1px solid var(--stroke);border-radius:999px;padding:9px 14px;
  min-width:190px;color:var(--muted);font-size:13px;white-space:nowrap;display:flex;align-items:center;gap:8px}
.iconbtn{width:40px;height:40px;border-radius:11px;border:1px solid var(--stroke);background:var(--surface);
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted)}
.iconbtn:hover{background:var(--surface2)}
.bell{position:relative}
.bell .badge{position:absolute;top:-4px;left:-4px;background:var(--danger);color:#fff;font-size:10px;font-weight:700;min-width:17px;height:17px;border-radius:999px;display:flex;align-items:center;justify-content:center}

/* البطاقات والحبوب */
.card{background:var(--surface);border:1px solid var(--stroke);border-radius:16px;padding:18px;box-shadow:var(--shadow)}
.card.tight{padding:14px}
.sec-h{font-size:16.5px;font-weight:700;margin:2px 0 10px}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:700;padding:3px 10px;border-radius:999px}
.pill-soft{background:color-mix(in srgb,var(--primary) 12%,var(--surface));color:var(--brandInk)}
.pill-line{border:1px solid var(--stroke);color:var(--muted)}
.tint{background:color-mix(in srgb,var(--primary) 10%,var(--surface))}
.muted{color:var(--muted)}
.hr{height:1px;background:var(--stroke2);border:0;margin:14px 0}

/* البطل (Hero) */
.hero{border-radius:22px;padding:34px 32px 28px;color:#fff;position:relative;overflow:hidden;background:var(--hero)}
.hero::before{content:"";position:absolute;inset:0;background:
  radial-gradient(400px 200px at 15% 20%,rgba(76,211,122,.26),transparent),
  radial-gradient(420px 220px at 85% 30%,rgba(90,180,248,.22),transparent)}
.hero>*{position:relative}
.hero h1{font-size:32px;font-weight:700;margin:12px 0 6px}
.hero .sub{font-size:15px;color:rgba(255,255,255,.84);max-width:560px}
.hero .status{display:inline-flex;align-items:center;gap:7px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.18);
  border-radius:999px;padding:5px 12px;font-size:12.5px;font-weight:600}
.hero .hsearch{background:#fff;border-radius:15px;padding:14px 16px;display:flex;align-items:center;gap:10px;color:#64708A;max-width:560px;margin-top:16px}
.hero .hsearch .k{margin-inline-start:auto;background:#EDEDF2;border-radius:8px;padding:3px 8px;font-size:11px;color:#64708A}
.hero .hicon{position:absolute;top:26px;inset-inline-end:32px;width:120px;height:120px;border-radius:30px;box-shadow:0 20px 40px rgba(0,0,0,.3)}
@media(max-width:700px){.hero .hicon{display:none}}

/* شبكة البلاطات */
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:14px}
.tile{background:var(--surface);border:1px solid var(--stroke);border-radius:16px;padding:18px;box-shadow:var(--shadow);transition:.15s;cursor:pointer;display:block}
.tile:hover{border-color:var(--brandInk);transform:translateY(-2px)}
.tile:hover{text-decoration:none}
.tile-top{display:flex;align-items:flex-start;justify-content:space-between}
.tile-top .arrow{color:var(--muted2);margin-top:6px}
.tile-top .arrow svg{width:18px;height:18px}
.badge-ic{width:48px;height:48px;border-radius:15px;display:flex;align-items:center;justify-content:center}
.badge-ic svg{width:24px;height:24px}
.tile .tn{font-size:16.5px;font-weight:700;margin:12px 0 4px}
.tile .td{font-size:12.5px;color:var(--muted);line-height:1.6}
.tile .st{font-size:12.5px;font-weight:700;margin-top:10px}

/* صفوف المواضيع */
.topic{display:flex;gap:12px;padding:14px 0;border-bottom:1px solid var(--stroke2)}
.topic:last-child{border-bottom:0}
.votebox{flex:0 0 46px;height:58px;border-radius:12px;border:1px solid var(--stroke);display:flex;flex-direction:column;
  align-items:center;justify-content:center;font-weight:700;color:var(--muted);cursor:pointer;user-select:none}
.votebox.on{background:var(--primary);border-color:var(--primary);color:#fff}
.votebox .vn{font-size:16px}
.votebox .vl{font-size:9.5px}
.topic .tt{font-size:15.5px;font-weight:700;margin:5px 0 3px;color:var(--ink)}
.topic .ex{font-size:12.5px;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.metarow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;font-size:11.5px;color:var(--muted)}
.avatar{width:24px;height:24px;border-radius:999px;background:color-mix(in srgb,var(--primary) 14%,var(--surface));color:var(--brandInk);
  display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:12px}
.official{display:inline-flex;align-items:center;gap:5px;color:var(--brandInk);font-weight:700}
.official img{width:16px;height:16px;border-radius:5px}

/* نافذة الدخول */
.overlay{position:fixed;inset:0;background:rgba(9,14,30,.55);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:80;padding:18px}
.modal{background:var(--surface);border-radius:24px;max-width:440px;width:100%;box-shadow:0 30px 70px rgba(0,0,0,.35);overflow:hidden}
.modal .mh{background:var(--hero);color:#fff;padding:22px;text-align:center}
.modal .mh img{width:52px;height:52px;border-radius:15px;margin:0 auto 10px}
.modal .mb{padding:20px}
.seg{display:flex;background:var(--field);border-radius:12px;padding:4px;margin-bottom:14px}
.seg button{flex:1;border:0;background:transparent;padding:9px;border-radius:9px;font-family:inherit;font-weight:700;font-size:13px;color:var(--muted);cursor:pointer}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
.field{width:100%;border:1px solid var(--stroke);background:var(--field);border-radius:13px;padding:12px 14px;font-family:inherit;font-size:14px;color:var(--ink);margin-bottom:10px}
.field:focus{outline:0;border-color:var(--primary)}
.infobox{background:var(--surface2);border:1px solid var(--stroke2);border-radius:12px;padding:12px;font-size:12px;color:var(--muted);line-height:1.7;margin:6px 0 12px}

/* التبويبات */
.tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.tabs a{padding:7px 13px;border-radius:999px;font-size:12.5px;font-weight:700;color:var(--muted);border:1px solid transparent}
.tabs a.on{background:color-mix(in srgb,var(--primary) 10%,var(--surface));color:var(--brandInk);border-color:color-mix(in srgb,var(--primary) 30%,transparent)}
.tabs a:hover{background:var(--surface2)}

/* الجانب الأيمن (rail) */
.rail{flex:1 1 300px;max-width:340px;display:flex;flex-direction:column;gap:16px}
.two{display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap}

.toast{position:fixed;bottom:20px;inset-inline-start:20px;background:var(--surface);border:1px solid var(--stroke);
  border-radius:14px;padding:12px 16px;box-shadow:var(--lift);z-index:90;font-size:13.5px;font-weight:600}

@media(max-width:820px){
  .side{flex:1 1 100%;position:static;max-height:none}
  .nav{flex-direction:row;flex-wrap:wrap}
  .nav a{flex:0 0 auto}
  .navsec,.side-foot,.side .hotcats{display:none}
}
