/* ORCHESTRA — لوحة التحكم. الألوان والخطوط والزوايا من brand-tokens.json */
@font-face { font-family: 'Noto Kufi Arabic'; src: url(brand/fonts/NotoKufiArabic-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Kufi Arabic'; src: url(brand/fonts/NotoKufiArabic-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Noto Sans Arabic'; src: url(brand/fonts/NotoSansArabic-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans Arabic'; src: url(brand/fonts/NotoSansArabic-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Noto Sans'; src: url(brand/fonts/NotoSans-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans'; src: url(brand/fonts/NotoSans-Bold.ttf); font-weight: 700; font-display: swap; }

:root {
  --night: #11131B; --panel: #1B1E2A; --panel2: #232738; --line: rgba(244, 242, 234, .09);
  --text: #F4F2EA; --muted: #A3ABBC; --mint: #A6F5D0; --violet: #9B88FF; --red: #FF8D91; --amber: #FFD18B;
  --r-s: 8px; --r-m: 16px; --r-l: 24px; --dir: -1;
  --font-head: 'Noto Kufi Arabic', 'Noto Sans', sans-serif;
  --font-body: 'Noto Sans Arabic', 'Noto Sans', system-ui, sans-serif;
}
[dir=ltr] { --dir: 1; --font-head: 'Noto Sans', 'Noto Kufi Arabic', sans-serif; --font-body: 'Noto Sans', 'Noto Sans Arabic', system-ui, sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--night); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.6; }
body { background: radial-gradient(1000px 500px at 85% -10%, rgba(155, 136, 255, .10), transparent 60%), var(--night); background-attachment: fixed; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); font-weight: 700; }
p { margin: 0; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow-end { margin-inline-start: auto; }
::selection { background: rgba(155, 136, 255, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #2c3144; border-radius: 10px; }

/* أزرار */
.btn { background: var(--mint); color: var(--night); border: 0; padding: 9px 20px; border-radius: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid rgba(244, 242, 234, .18); }
.btn.ghost:hover { background: rgba(244, 242, 234, .06); filter: none; }
.btn.danger { background: rgba(255, 141, 145, .14); color: var(--red); }
.btn.danger:hover { background: rgba(255, 141, 145, .24); }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 13px 28px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* حقول */
input[type=text], input[type=number], select, textarea {
  width: 100%; background: var(--night); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font: inherit; outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(155, 136, 255, .18); }
input[type=color] { width: 72px; height: 42px; padding: 3px; border-radius: 10px; background: var(--night); border: 1px solid var(--line); }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
[dir=rtl] select { background-position: 18px 50%, 13px 50%; }
option { background: var(--panel); }

/* مفتاح التفعيل */
.switch { position: relative; width: 50px; height: 28px; display: inline-block; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #343949; border-radius: 28px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; inset-inline-start: 3px; background: var(--text); border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::before { background: var(--night); transform: translateX(calc(var(--dir) * 22px)); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(155, 136, 255, .35); }

/* أيقونات وشارات */
.ico { width: 22px; height: 22px; flex: none; }
.badge { width: 44px; height: 44px; border-radius: 14px; background: rgba(155, 136, 255, .13); display: grid; place-items: center; flex: none; }
.badge .ico { width: 24px; height: 24px; }
.badge.lg { width: 56px; height: 56px; border-radius: 18px; } .badge.lg .ico { width: 30px; height: 30px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; background: rgba(244, 242, 234, .08); color: var(--muted); }
.tag.ok { background: rgba(166, 245, 208, .14); color: var(--mint); }
.eyebrow { display: inline-block; border: 1px solid rgba(166, 245, 208, .45); color: var(--mint); border-radius: 30px; padding: 3px 14px; font-size: 12px; font-weight: 700; letter-spacing: .5px; }

/* الصفحة الرئيسية */
.landing { max-width: 1120px; margin: 0 auto; padding: 0 24px 80px; }
.land-nav, .topbar.solo { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.logo { height: 58px; width: auto; display: block; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding: 56px 0 40px; }
.hero h1 { font-size: 54px; line-height: 1.35; margin: 18px 0 14px; }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.9; max-width: 620px; margin-bottom: 28px; }
.hero-art { display: grid; place-items: center; }
.symbol-xl { width: min(380px, 80%); filter: drop-shadow(0 20px 60px rgba(166, 245, 208, .18)); }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 20px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; display: grid; gap: 6px; align-content: start; transition: .2s; }
.feature:hover { border-color: rgba(166, 245, 208, .35); transform: translateY(-2px); }
.feature .badge { margin-bottom: 8px; }
.feature b { font-family: var(--font-head); }

/* اختيار السيرفر */
.topbar.solo { max-width: 1120px; margin: 0 auto; padding: 14px 24px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 24px 60px; }
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.guild-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px; display: grid; gap: 16px; transition: .2s; }
.guild-card:hover { border-color: rgba(155, 136, 255, .5); transform: translateY(-2px); }
.guild-card .head { display: flex; gap: 14px; align-items: center; min-width: 0; }
.gicon { width: 52px; height: 52px; border-radius: 16px; background: var(--panel2); display: grid; place-items: center; font-weight: 700; overflow: hidden; flex: none; font-family: var(--font-head); }
.gicon img { width: 100%; height: 100%; object-fit: cover; }
.guild-card .meta { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.guild-card .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* هيكل صفحات السيرفر */
.shell { display: grid; grid-template-columns: 276px 1fr; min-height: 100vh; }
.col { min-width: 0; }
.side { background: var(--panel); border-inline-end: 1px solid var(--line); padding: 14px 12px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: block; padding: 4px 8px 10px; }
.side .logo { height: 52px; }
.switcher { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--night); border: 1px solid var(--line); margin-bottom: 8px; transition: .15s; }
.switcher:hover { border-color: rgba(166, 245, 208, .35); }
.switcher .gicon { width: 38px; height: 38px; border-radius: 12px; }
.switcher .meta { min-width: 0; display: grid; }
.switcher b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher small { color: var(--muted); font-size: 12px; }
.side h4 { color: var(--muted); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; margin: 18px 10px 6px; font-weight: 700; }
.side nav a { display: flex; gap: 12px; padding: 9px 12px; border-radius: 12px; color: #cfd3de; align-items: center; position: relative; transition: .15s; }
.side nav a .ico { width: 20px; height: 20px; opacity: .85; }
.side nav a:hover { background: rgba(244, 242, 234, .05); }
.side nav a.active { background: rgba(166, 245, 208, .10); color: var(--mint); font-weight: 700; }
.side nav a.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--mint); }
.side nav a.active .ico { opacity: 1; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: rgba(17, 19, 27, .7); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.userchip { display: flex; gap: 10px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel2); object-fit: cover; flex: none; }
.who { display: flex; gap: 10px; align-items: center; }
.who .avatar { width: 28px; height: 28px; }
.menu-btn { display: none; }

.main { padding: 28px 32px 90px; max-width: 980px; }
.page-head { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; justify-content: space-between; }
.page-head .title { flex: 1; }
.page-head h2 { font-size: 26px; line-height: 1.5; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-head .badge { order: -1; }

/* بطاقات */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; margin-bottom: 16px; }
.card h3 { font-size: 17px; margin-bottom: 10px; }
.card.master { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: rgba(166, 245, 208, .22); background: linear-gradient(135deg, rgba(166, 245, 208, .07), transparent 60%), var(--panel); }
.card.master .lbl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card.master b { font-family: var(--font-head); font-size: 17px; }
.status { font-size: 12px; padding: 2px 10px; border-radius: 20px; font-weight: 700; }
.status.on { background: rgba(166, 245, 208, .15); color: var(--mint); } .status.off { background: rgba(244, 242, 234, .08); color: var(--muted); }
.card.fields { padding: 4px 20px; transition: opacity .2s; }
.card.fields.dim { opacity: .55; }
.field { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; align-items: start; }
.field:last-child { border-bottom: 0; }
.field.inline { grid-template-columns: 1fr auto; align-items: center; }
.field .lbl b { display: block; font-weight: 700; }
.field .lbl small { color: var(--muted); display: block; margin-top: 2px; }
.field.wide { grid-template-columns: 1fr; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { background: rgba(155, 136, 255, .14); border: 1px solid rgba(155, 136, 255, .3); border-radius: 20px; padding: 3px 6px; padding-inline-start: 12px; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.chip button { background: none; border: 0; color: var(--muted); padding: 0 4px; font-size: 16px; line-height: 1; }
.chip button:hover { color: var(--red); }
.list-item { background: var(--night); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; display: grid; gap: 10px; }
.list-item .row-f { display: grid; gap: 4px; }
.list-item .row-f small { color: var(--muted); }

/* شريط الحفظ */
.savebar { position: sticky; bottom: 18px; margin-top: 18px; background: rgba(27, 30, 42, .95); backdrop-filter: blur(10px); border: 1px solid rgba(155, 136, 255, .45); border-radius: 16px; padding: 12px 16px; display: none; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 16px 50px rgba(0, 0, 0, .5); }
.savebar.show { display: flex; animation: rise .25s ease; }
.savebar .msg { color: var(--amber); font-weight: 700; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* نظرة عامة */
.hero-card { position: relative; overflow: hidden; background: linear-gradient(120deg, rgba(166, 245, 208, .10), rgba(155, 136, 255, .10)), var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); padding: 28px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.hero-card h3 { font-size: 28px; margin: 10px 0 16px; }
.symbol-card { width: 130px; opacity: .9; flex: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; display: flex; gap: 14px; align-items: center; }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.2; font-family: var(--font-head); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; }
svg.chart { width: 100%; height: auto; display: block; direction: ltr; }
svg.chart text { fill: var(--muted); font-size: 11px; font-family: 'Noto Sans', sans-serif; }
svg.chart line { stroke: var(--line); }

/* جداول وأدوات */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .5px; }
tbody tr:hover { background: rgba(244, 242, 234, .03); }
.table-wrap { overflow-x: auto; padding: 8px 12px; }
.tabs, .toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar > select, .toolbar > input { width: auto; min-width: 170px; }
.count { margin-bottom: 10px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }
.tool-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.tool.card .fields { padding: 0; }
.tool-foot { margin-top: 14px; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

#toasts { position: fixed; bottom: 22px; inset-inline-end: 22px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--panel2); border: 1px solid var(--line); border-inline-start: 4px solid var(--mint); padding: 12px 18px; border-radius: 12px; min-width: 240px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: rise .25s ease; }
.toast.err { border-inline-start-color: var(--red); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: start; padding-top: 24px; } .hero h1 { font-size: 38px; } .hero-art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; inset-inline-start: 0; width: 280px; z-index: 30; transition: .22s; }
  [dir=rtl] .side { transform: translateX(100%); } [dir=ltr] .side { transform: translateX(-100%); }
  .side.open { transform: none !important; box-shadow: 0 0 60px rgba(0, 0, 0, .7); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; } .main { padding: 18px 16px 90px; }
  .field, .field.inline { grid-template-columns: 1fr; } .field.inline { grid-template-columns: 1fr auto; }
  .hero-card { flex-direction: column; align-items: flex-start; } .symbol-card { width: 90px; }
  .userchip span { display: none; }
}
