/* ===== West Town RP · لوحة الإدارة ===== */
:root {
  --bg: #07080B;
  --side: rgba(14, 10, 12, 0.92);
  --card: rgba(18, 12, 15, 0.88);
  --card-solid: #120C0F;
  --field: #0C090B;
  --line: #2A1A1E;
  --line2: #1E1416;
  --text: #F3EEEF;
  --muted: #A1979A;
  --soft: #C9BFC1;
  --accent: #E11D2E;
  --accent-hi: #FF3646;
  --accent-deep: #7A0E18;
  --ok: #22C55E;
  --bad: #FF6B6B;
  --gold: #F2C14E;
  --sel: rgba(225, 29, 46, 0.12);
  --radius: 14px;
  --glow: 0 0 0 1px rgba(225, 29, 46, 0.35), 0 0 24px rgba(225, 29, 46, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font-family: 'Readex Pro', Tahoma, sans-serif; color: var(--text); }
button, input, textarea, select { font-family: inherit; }
svg { flex-shrink: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: Consolas, monospace; color: var(--soft); }
.soft { color: var(--soft); }
.note { font-size: 13px; color: var(--muted); line-height: 1.7; }
h1 { margin: 0; font-size: 28px; font-weight: 700; }
h2 { margin: 0; font-size: 18px; font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* ===== الخلفية ===== */
.backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(225, 29, 46, 0.28), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, rgba(225, 29, 46, 0.10), transparent 70%),
    var(--bg);
  background-size: cover; background-position: center;
}
.backdrop.has-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 8, 11, 0.55), rgba(7, 8, 11, 0.92)); }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 46vh; opacity: 0.5; }
.skyline svg { width: 100%; height: 100%; display: block; }
.backdrop.has-image .skyline { display: none; }

/* ===== الشعار ===== */
.emblem { display: inline-flex; border-radius: 50%; }
.emblem svg, .emblem img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }
.emblem.tiny { width: 22px; height: 22px; }
.emblem.small { width: 48px; height: 48px; box-shadow: 0 0 16px rgba(225, 29, 46, 0.45); }
.emblem.big { width: 96px; height: 96px; box-shadow: 0 0 40px rgba(225, 29, 46, 0.5); }
.emblem.huge { width: 112px; height: 112px; box-shadow: 0 0 0 4px rgba(225, 29, 46, 0.25), 0 0 60px rgba(225, 29, 46, 0.55); }

/* ===== تسجيل الدخول ===== */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(700px 360px at 50% 20%, rgba(225, 29, 46, 0.25), transparent 70%), var(--bg);
}
.login-box {
  width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 32px 28px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--glow);
}
.login-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin-bottom: 8px; }
.login-hero .brand-name { font-size: 22px; margin-top: 8px; }
.err { color: var(--bad); font-size: 14px; text-align: center; }
.wide { width: 100%; height: 48px; font-size: 16px; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px; align-self: center; text-decoration: underline; }
.link-btn:hover { color: var(--text); }
.login-form { display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; }

/* ===== الهيكل ===== */
#app { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
#app > *:not(.backdrop) { position: relative; z-index: 1; }
#app > .shell { z-index: 3; }

.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 16px 24px 8px;
}
.tb-brand {
  justify-self: start; display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px 10px 20px;
}
.brand-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.crown { width: 18px; height: 18px; color: var(--gold); }
.rank-line { font-size: 13px; color: var(--accent-hi); font-weight: 500; }
.hero { display: flex; align-items: center; gap: 24px; }
.hero-text { display: flex; flex-direction: column; line-height: 1; }
.hero-title { font-size: 44px; font-weight: 700; font-style: italic; letter-spacing: 1px; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6); direction: ltr; }
.hero-sub { font-size: 34px; font-weight: 700; font-style: italic; color: var(--accent); letter-spacing: 1px; direction: ltr; margin-top: 4px; }
.hero-tag { font-size: 13px; letter-spacing: 4px; color: var(--soft); margin-top: 12px; direction: ltr; }
.tb-tools { justify-self: end; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); color: var(--soft); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn svg, .btn svg, .logout-btn svg, .nav-item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }

.shell { flex: 1; display: flex; gap: 20px; padding: 12px 24px 16px; align-items: flex-start; }
.main { flex: 1; min-width: 0; order: 0; }
.side {
  width: 250px; flex-shrink: 0; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px;
}
.nav {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--side); border: 1px solid var(--line); border-radius: 18px; padding: 10px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 0 14px; font-size: 15px; font-weight: 500; border-radius: 12px;
  color: var(--soft); background: transparent; border: 1px solid transparent; text-align: right; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.nav-item svg { color: var(--accent); }
.nav-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.nav-item.on {
  color: #fff; background: linear-gradient(90deg, rgba(225, 29, 46, 0.55), rgba(225, 29, 46, 0.25));
  border-color: rgba(255, 70, 80, 0.6); box-shadow: 0 0 18px rgba(225, 29, 46, 0.35);
}
.nav-item.on svg { color: #fff; }
.nav-item:disabled { cursor: default; opacity: .5; }
.nav-item .soon { margin-right: auto; font-size: 11px; color: var(--muted); }

.me-card { background: var(--side); border: 1px solid var(--line); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px; }
.me-name { font-size: 14px; font-weight: 700; }
.me-text { min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; background: var(--line2); object-fit: cover; }
.avatar.ring { width: 44px; height: 44px; box-shadow: 0 0 0 2px var(--accent); }
.logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px;
  background: transparent; border: 1px solid var(--line); color: var(--soft); cursor: pointer; font-size: 14px;
}
.logout-btn svg { color: var(--accent); }
.logout-btn:hover { border-color: var(--accent); color: var(--text); }
.scrim { display: none; }

.foot {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 24px 20px;
  font-size: 13px; color: var(--muted);
}

/* ===== عناصر عامة ===== */
.page { display: flex; flex-direction: column; gap: 18px; animation: pageIn .25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.grow2 { flex: 2 1 440px; min-width: 0; }
.grow1 { flex: 1 1 300px; min-width: 0; }
.grow3 { flex: 3 1 260px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.35); font-size: 14px; color: #7EE2A3;
}
.pill.off { background: rgba(255, 107, 107, 0.08); border-color: rgba(255, 107, 107, 0.35); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex-shrink: 0; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.bad { background: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; font-size: 14px; color: var(--text); border-radius: 10px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { color: #fff; background: linear-gradient(180deg, var(--accent-hi), var(--accent)); border: 0; font-weight: 700; box-shadow: 0 6px 18px rgba(225, 29, 46, 0.35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: rgba(255, 107, 107, 0.35); }
.btn.danger:hover { background: rgba(255, 107, 107, 0.08); }
.btn.danger.big { height: 48px; font-weight: 700; font-size: 15px; width: 100%; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.discord { background: #5865F2; color: #fff; border: 0; font-weight: 700; text-decoration: none; }
.btn.discord:hover { background: #4752C4; }
.btn.discord svg { fill: currentColor; stroke: none; width: 22px; height: 22px; }

.welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.welcome h1 { font-size: 24px; }

/* ===== بطاقات الإحصائيات ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.stat {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.stat::after { content: ''; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--c, var(--accent)); opacity: .6; }
.stat-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.stat-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.stat .v { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 14px; color: var(--soft); }
.stat .sub { font-size: 12px; color: var(--muted); }
.spark { position: absolute; left: 14px; bottom: 14px; width: 90px; height: 32px; }

/* ===== الرسم البياني ===== */
.chart { width: 100%; min-height: 200px; }
.chart svg { width: 100%; height: 220px; display: block; }
.chart .empty-chart { height: 200px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; text-align: center; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-row .bl { display: flex; justify-content: space-between; font-size: 14px; }
.bar-track { height: 8px; border-radius: 999px; background: var(--line2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--c, var(--accent)); }

/* ===== قوائم ===== */
.prow { display: flex; align-items: center; gap: 12px; min-height: 56px; border-top: 1px solid var(--line2); flex-wrap: wrap; padding: 6px 0; }
.prow:first-child { border-top: 0; }
.pid { min-width: 36px; height: 36px; padding: 0 6px; border-radius: 10px; background: rgba(59, 130, 246, 0.15); color: #8DB7FF; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.pinfo { flex: 1 1 140px; display: flex; flex-direction: column; }
.pinfo b { font-size: 15px; }
.logs { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.log { font-size: 14px; display: flex; gap: 10px; align-items: baseline; }
.log .t { font-size: 12px; color: var(--muted); min-width: 44px; }

/* ===== الفلاتر والحقول ===== */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
input[type=text], input[type=password], textarea, select {
  height: 44px; background: var(--field); border: 1px solid var(--line); color: var(--text); border-radius: 10px;
  font-size: 15px; padding: 0 14px; outline: none; width: 100%;
}
textarea { height: auto; padding: 10px 14px; resize: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.18); }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; }
.seg button {
  flex: 1; height: 38px; font-size: 14px; color: var(--soft); background: transparent; border: 0; border-radius: 9px;
  cursor: pointer; padding: 0 14px; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { color: #fff; background: var(--accent); box-shadow: 0 4px 14px rgba(225, 29, 46, 0.35); }

/* ===== الجداول ===== */
.grow-table { flex: 999 1 520px; min-width: 0; padding: 0; }
.table-box { overflow: auto; max-height: 70vh; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
th { padding: 14px 10px; font-weight: 500; color: var(--muted); font-size: 13px; text-align: right; position: sticky; top: 0; background: var(--card-solid); z-index: 1; }
th:first-child, td:first-child { padding-right: 18px; }
td { padding: 13px 10px; }
tbody tr { border-top: 1px solid var(--line2); cursor: pointer; transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
tbody tr.sel { background: var(--sel); box-shadow: inset -3px 0 0 var(--accent); }
td.wrap { max-width: 340px; white-space: normal; }
.ini {
  width: 36px; height: 36px; border-radius: 10px; background: rgba(59, 130, 246, 0.15); color: #8DB7FF;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
tr.sel .ini { background: var(--accent); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 4px 10px; font-size: 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.on { color: var(--bad); border-color: rgba(255, 107, 107, 0.35); background: rgba(255, 107, 107, 0.08); }

/* ===== لوحة التفاصيل ===== */
.detail {
  flex: 1 1 320px; min-width: 0; position: relative; overflow: hidden;
  border-color: rgba(225, 29, 46, 0.45); box-shadow: var(--glow);
  padding: 22px; display: flex; flex-direction: column; gap: 14px; align-self: flex-start;
}
.d-head { display: flex; align-items: center; gap: 14px; }
.d-head .diamond {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #2A0B10, #120709); box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(225, 29, 46, 0.4);
  font-weight: 700; color: #fff;
}
.d-name { font-size: 20px; font-weight: 700; }
.money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.money > div { background: var(--field); border: 1px solid var(--line2); border-radius: 12px; padding: 12px; }
.money .v { font-size: 18px; font-weight: 700; }
.kv { display: flex; justify-content: space-between; font-size: 14px; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line2); }
.kv span:first-child { color: var(--muted); }
.d-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.d-actions.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-actions .btn { height: 44px; }

/* ===== نوافذ وتنبيهات ===== */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 16px; }
.modal-box {
  width: min(480px, 100%); background: var(--card-solid); border: 1px solid rgba(225, 29, 46, 0.45); border-radius: 18px;
  padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--glow); max-height: 90vh; overflow-y: auto;
}
.modal-body { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 40;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px 12px 16px; font-size: 15px;
  max-width: calc(100% - 32px); display: flex; align-items: center; gap: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn .2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast::before { content: ''; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--ok); }
.toast.ok { border-color: rgba(34, 197, 94, 0.45); }
.toast.bad { border-color: rgba(255, 107, 107, 0.45); color: var(--bad); }
.toast.bad::before { background: var(--bad); }

/* ===== بحث سريع ===== */
.palette { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); display: flex; justify-content: center; padding: 12vh 16px 16px; }
.palette-box {
  width: min(600px, 100%); align-self: flex-start; background: var(--card-solid); border: 1px solid rgba(225, 29, 46, 0.45);
  border-radius: 18px; box-shadow: var(--glow); overflow: hidden;
}
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.palette-input input { border: 0; background: transparent; height: 58px; font-size: 16px; box-shadow: none !important; padding: 0; }
kbd { font-family: Consolas, monospace; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.palette-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.pal-group { font-size: 12px; color: var(--muted); padding: 10px 10px 4px; }
.pal-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 12px; border-radius: 10px;
  background: transparent; border: 0; color: var(--text); cursor: pointer; text-align: right; font-size: 15px;
}
.pal-item svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pal-item small { margin-right: auto; color: var(--muted); font-size: 12px; }
.pal-item.on, .pal-item:hover { background: var(--sel); }
.pal-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ===== الرتب ===== */
.note-card { font-size: 14px; color: var(--soft); line-height: 1.8; }
.ranks-table td, .ranks-table th { text-align: center; }
.ranks-table td:first-child, .ranks-table th:first-child { text-align: right; }
.ranks-table input[type=text] { height: 38px; font-size: 13px; min-width: 200px; font-family: Consolas, monospace; direction: ltr; text-align: left; }
.ranks-table input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.ranks-table input[type=checkbox]:disabled { cursor: default; opacity: .6; }
.arow { display: flex; align-items: center; gap: 12px; min-height: 56px; border-top: 1px solid var(--line2); flex-wrap: wrap; }
.arow .grow { flex: 1 1 160px; display: flex; flex-direction: column; }

/* ===== العصابات ===== */
.gang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.gang-card {
  text-align: right; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer;
  color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s;
}
.gang-card:hover { border-color: rgba(225, 29, 46, 0.45); }
.gang-card.on { border-color: var(--accent); background: var(--sel); box-shadow: var(--glow); }
.gang-card b { font-size: 16px; }
.gang-card .nums { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.gang-card .nums span b { font-size: 13px; color: var(--text); }

/* ===== المخازن ===== */
.inv-side { display: flex; flex-direction: column; gap: 8px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; margin-top: 6px; }
.pick {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; padding: 6px 12px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line2); color: var(--text); cursor: pointer; text-align: right; font-size: 14px;
}
.pick:hover { border-color: rgba(225, 29, 46, 0.45); }
.pick.on { border-color: var(--accent); background: var(--sel); }
.pick small { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.slot {
  position: relative; background: var(--field); border: 1px solid var(--line2); border-radius: 12px; padding: 12px; min-height: 100px;
  display: flex; flex-direction: column; gap: 4px; justify-content: space-between;
}
.slot:hover { border-color: rgba(225, 29, 46, 0.4); }
.slot .sn { position: absolute; top: 8px; left: 10px; font-size: 11px; color: var(--muted); }
.slot b { font-size: 14px; line-height: 1.4; padding-left: 18px; word-break: break-word; }
.slot .cnt { font-size: 18px; font-weight: 700; color: var(--accent-hi); }
.slot .nm { font-size: 11px; color: var(--muted); font-family: Consolas, monospace; direction: ltr; text-align: right; }
.slot .rm { position: absolute; bottom: 8px; left: 8px; }
.banner { grid-column: 1 / -1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-size: 14px; color: var(--soft); }
.banner.warn { border-color: rgba(242, 193, 78, 0.35); color: var(--gold); }
.search-results { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }

/* ===== السجلات ===== */
.pager { justify-content: center; }

/* ===== الخريطة ===== */
.map-card { padding: 8px; }
#mapSvg { width: 100%; height: 70vh; min-height: 360px; display: block; border-radius: 10px; background: #0A0709; }
.mrow {
  display: flex; align-items: center; gap: 10px; min-height: 48px; width: 100%; border: 0; border-top: 1px solid var(--line2);
  background: transparent; color: var(--text); cursor: pointer; text-align: right; padding: 6px 4px; border-radius: 8px;
}
.mrow:first-child { border-top: 0; }
.mrow:hover, .mrow.on { background: var(--sel); }
.mrow .grow { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
.mrow .grow span { font-size: 12px; color: var(--muted); }

/* ===== شاشات متوسطة ===== */
@media (max-width: 1200px) {
  .hero .emblem.huge { width: 84px; height: 84px; }
  .hero-title { font-size: 34px; }
  .hero-sub { font-size: 26px; }
}

/* ===== الجوال والتابلت ===== */
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding: 12px 16px 4px; }
  .hero { display: none; }
  .tb-brand { padding: 8px 12px; }
  .tb-brand .emblem.small { width: 40px; height: 40px; }
  .menu-btn { display: inline-flex; }
  .tb-tools .pill { display: none; }
  .avatar.ring { display: none; }
  .shell { padding: 12px 16px 16px; }
  .side {
    position: fixed; top: 0; bottom: 0; right: 0; width: min(300px, 85vw); z-index: 25; padding: 16px;
    background: #0B0709; border-left: 1px solid var(--line); overflow-y: auto;
    transform: translateX(100%); transition: transform .25s ease;
  }
  .side.open { transform: translateX(0); box-shadow: -20px 0 40px rgba(0, 0, 0, 0.6); }
  .scrim { position: fixed; inset: 0; z-index: 24; background: rgba(0, 0, 0, 0.55); }
  .scrim.open { display: block; }
  .nav-item:disabled { display: none; }
  h1 { font-size: 22px; }
  .welcome h1 { font-size: 20px; }
  .stat .v { font-size: 24px; }
  .spark { display: none; }
}
@media (max-width: 480px) {
  .tb-brand .rank-line { display: none; }
  .brand-name { font-size: 15px; }
  .d-actions.grid2 { grid-template-columns: 1fr; }
  .money { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3A2025; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== شبكة الإجراءات ===== */
.act-title { display: flex; align-items: center; gap: 8px; font-size: 15px; letter-spacing: .5px; }
.act-title svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.act {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border-radius: 12px; text-align: right;
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line2); color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.act:hover:not(:disabled) { border-color: rgba(225, 29, 46, 0.45); background: rgba(255, 255, 255, 0.04); }
.act:disabled { cursor: not-allowed; opacity: .38; }
.act-ic {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.05); color: var(--soft);
}
.act-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.act.t-ok .act-ic { background: rgba(34, 197, 94, 0.14); color: #6EE7A0; }
.act.t-bad .act-ic { background: rgba(225, 29, 46, 0.18); color: #FF6B76; }
.act.t-warn .act-ic { background: rgba(245, 158, 11, 0.16); color: #FBBF5A; }
.act.is-on { border-color: rgba(59, 130, 246, 0.55); background: rgba(59, 130, 246, 0.08); }
.act-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.act-txt b { font-size: 14px; font-weight: 600; }
.act-txt span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; border: 1px solid rgba(245, 158, 11, 0.5); color: #FBBF5A; background: rgba(245, 158, 11, 0.1); }

/* ===== إدارة اللاعب ===== */
.pl-search { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.pl-search h1 { font-size: 24px; }
.pl-search-box { position: relative; flex: 0 1 440px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pl-results {
  position: absolute; top: 100%; right: 0; left: 0; z-index: 10; margin-top: 6px; background: var(--card-solid);
  border: 1px solid rgba(225, 29, 46, 0.45); border-radius: 12px; padding: 6px; box-shadow: var(--glow); max-height: 320px; overflow-y: auto;
}
.pl-results .pick { width: 100%; margin-bottom: 4px; }
.pl-profile { display: flex; flex-direction: column; gap: 16px; border-color: rgba(225, 29, 46, 0.45); box-shadow: var(--glow); }
.pl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.pl-who { display: flex; align-items: center; gap: 14px; }
.pl-avatar {
  width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
  background: radial-gradient(circle, #2A0B10, #120709); box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(225, 29, 46, 0.4);
}
.pl-name { font-size: 22px; font-weight: 700; }
.pl-status { font-size: 13px; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.pl-others { position: relative; }
.pl-menu {
  position: absolute; top: 100%; left: 0; z-index: 10; margin-top: 6px; min-width: 220px; background: var(--card-solid);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.pl-menu .pick { width: 100%; margin-bottom: 4px; }
.pl-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0 28px; }
.pl-info .kv { padding: 9px 0; }
.pl-info .kv span:last-child { direction: ltr; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%; }
.pl-info .kv span.rtl { direction: rtl; text-align: right; }
.pl-inv { display: flex; flex-direction: column; gap: 6px; }
.pl-inv-list { display: flex; flex-direction: column; max-height: 620px; overflow-y: auto; }
.pl-item { display: flex; align-items: center; gap: 12px; min-height: 60px; border-top: 1px solid var(--line2); }
.pl-item .slotn { width: 42px; height: 42px; border-radius: 10px; background: var(--field); border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.pl-item .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pl-item b { font-size: 14px; font-weight: 600; color: var(--accent-hi); }
.pl-item .grow span { font-size: 12px; color: var(--muted); }
.icon-sq { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(255, 107, 107, .08); border: 1px solid rgba(255, 107, 107, .3); color: var(--bad); }
.icon-sq svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn.warn-btn { color: #FBBF5A; border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .08); }
.pl-shot-card { display: flex; flex-direction: column; }
.pl-shot {
  flex: 1; min-height: 240px; border-radius: 12px; border: 1px dashed #3A2025; overflow: hidden;
  background: repeating-linear-gradient(45deg, #0C090B 0 12px, #100B0D 12px 24px);
  display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 14px; padding: 12px;
}
.pl-shot img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 8px; }
.pl-tabs { margin-bottom: 16px; overflow-x: auto; }
.pl-tab { display: flex; flex-direction: column; gap: 4px; }
.tl-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line2); }
.tl-row:first-child { border-top: 0; }
.tl-row .t { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 118px; font-family: Consolas, monospace; }
.tl-row .grow { flex: 1; min-width: 0; font-size: 14px; line-height: 1.6; }
.tl-row .by { font-size: 12px; color: var(--soft); }
.tab-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.tab-form .field { flex: 1 1 260px; }
.amt-in { color: var(--ok); font-weight: 700; }
.amt-out { color: var(--bad); font-weight: 700; }
.lic-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-top: 1px solid var(--line2); }
.lic-row:first-child { border-top: 0; }
.switch { position: relative; width: 50px; height: 28px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); cursor: pointer; padding: 0; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: right .15s, background .15s; }
.switch.on { background: rgba(34, 197, 94, .2); border-color: rgba(34, 197, 94, .5); }
.switch.on::after { right: 25px; background: var(--ok); }
.switch:disabled { opacity: .5; cursor: default; }
.need-bar { height: 6px; border-radius: 999px; background: var(--line2); overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; margin-left: 8px; }
.need-bar i { display: block; height: 100%; background: var(--ok); }

/* ===== البث ===== */
.live-badge { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: var(--accent); vertical-align: middle; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: livePulse 1s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .25; } }
.pl-shot img { transition: opacity .15s; }

.seg.seg-sm { padding: 3px; border-radius: 10px; }
.seg.seg-sm button { height: 30px; font-size: 12px; padding: 0 10px; border-radius: 7px; }
.pl-shot img { transition: none; }
