body.admin { background: #050a1c; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; background: rgba(8,15,38,.95); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.side .brand { margin: 0 6px 18px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 700; transition: background .2s, color .2s; }
.side a:hover { background: rgba(120,175,255,.07); color: var(--text); }
.side a.active { background: rgba(25,181,224,.14); color: var(--text); box-shadow: inset 0 0 0 1px rgba(25,181,224,.3); }
.side a .ic { width: 20px; height: 20px; }
.side .nbadge { margin-inline-start: auto; background: var(--red); color: #fff; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; font-size: 13px; color: var(--dim); padding: 0 6px; word-break: break-all; }
.main { padding: 26px 28px 60px; min-width: 0; }
.main h1 { font-size: 28px; margin-bottom: 4px; }
.main .sub { color: var(--muted); margin-bottom: 22px; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.kpi span { color: var(--muted); font-size: 13.5px; }
.kpi b { display: block; font-family: 'Changa', sans-serif; font-size: 28px; font-weight: 800; margin-top: 4px; }
.kpi.warn b { color: #ffd36e; }
.kpi.good b { color: var(--lime-2); }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.bars div { flex: 1; min-width: 4px; background: var(--grad); border-radius: 6px 6px 2px 2px; position: relative; transition: opacity .2s; }
.bars div:hover { opacity: .8; }
.bars div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--surface-solid); border: 1px solid var(--line-2); padding: 4px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; margin-bottom: 6px; }
.list { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(10,20,50,.5); border: 1px solid var(--line); font-size: 14px; }
.list-row b.n { color: #ffd36e; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: right; color: var(--dim); font-weight: 600; font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; transition: background .15s; }
.tbl tr.click:hover { background: rgba(120,175,255,.05); }
.tbl .muted { color: var(--dim); font-size: 12.5px; }
.tbl-wrap { overflow-x: auto; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips .tab { min-height: 38px; padding: 6px 14px; font-size: 13.5px; }
.toolbar2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar2 .input { height: 44px; max-width: 320px; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn-danger { background: rgba(255,77,106,.12); border: 1px solid rgba(255,77,106,.4); color: #ff8da0; }
.btn-danger:hover { background: rgba(255,77,106,.2); }
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { position: relative; width: min(860px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 22px; padding: 24px; animation: pop .3s var(--ease); box-shadow: 0 40px 100px -20px rgba(0,0,0,.8); }
.modal h2 { font-size: 22px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fgrid .span2 { grid-column: span 2; }
.fgrid .full { grid-column: 1 / -1; }
.field .input, .field select.input { height: 46px; font-size: 15px; }
.field label { font-size: 14px; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--lime); }
.opt-rows { display: grid; gap: 8px; }
.opt-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr auto auto; gap: 8px; align-items: center; }
.opt-row .input { height: 42px; font-size: 14px; padding: 0 10px; }
.opt-row.head { color: var(--dim); font-size: 12.5px; font-weight: 600; }
.stock-pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(140,214,42,.12); color: var(--lime-2); white-space: nowrap; }
.stock-pill.low { background: rgba(255,77,106,.12); color: #ff8da0; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.info-grid div { padding: 12px; border-radius: 12px; background: rgba(10,20,50,.5); border: 1px solid var(--line); font-size: 14px; word-break: break-word; }
.info-grid small { display: block; color: var(--dim); font-size: 12px; }
.deliver-form { display: grid; gap: 8px; margin-top: 10px; }
.deliver-form textarea { min-height: 70px; font-size: 14px; }
.events { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.events li { display: flex; gap: 10px; font-size: 13.5px; color: var(--muted); }
.events li time { color: var(--dim); white-space: nowrap; font-size: 12.5px; direction: ltr; }
.events li.error { color: #ff8da0; }
.sect { margin-top: 20px; }
.sect h3 { font-size: 17px; margin-bottom: 10px; }
.codes-area { min-height: 160px; font-family: ui-monospace, Consolas, monospace; direction: ltr; text-align: left; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-inline-end: 6px; }
.status-dot.off { background: var(--red); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-page .auth-card { width: min(420px, 100%); }
.mobile-top { display: none; }
@media (max-width: 1000px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 260px; z-index: 50; transform: translateX(100%); transition: transform .3s var(--ease); }
  .side.open { transform: none; box-shadow: -30px 0 60px rgba(0,0,0,.6); }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(5,10,28,.95); z-index: 40; }
  .main { padding: 18px 16px 60px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .fgrid, .info-grid { grid-template-columns: 1fr 1fr; }
  .opt-row { grid-template-columns: 1fr 1fr; }
  .opt-row.head { display: none; }
}
@media (max-width: 560px) {
  .fgrid, .info-grid { grid-template-columns: 1fr; }
  .fgrid .span2 { grid-column: auto; }
  .modal { padding: 18px; }
}
.chain { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.chain li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(10,20,50,.6); border: 1px solid var(--line-2); }
.chain .step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); font-weight: 800; font-size: 13px; flex: none; }
.chain .step-l { flex: 1; font-weight: 700; }
.chain .icon-btn { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.chain .icon-btn:disabled { opacity: .3; }
.chain-add { display: flex; gap: 8px; }
.chain-add .input { height: 42px; max-width: 320px; }
.opt-tbl td { padding: 6px; }
.opt-tbl .input { height: 40px; font-size: 14px; padding: 0 10px; min-width: 90px; }
details.adv summary { cursor: pointer; font-weight: 700; color: var(--cyan); }
.demo-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(255,203,69,.15); color: #ffd36e; border: 1px solid rgba(255,203,69,.35); vertical-align: middle; }
.demo-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 18px; border-radius: 16px; background: rgba(255,203,69,.08); border: 1px dashed rgba(255,203,69,.5); color: #ffe7a3; }
.demo-banner span { flex: 1; min-width: 220px; color: var(--muted); font-size: 14px; }
.demo-panel.on { border-color: rgba(255,203,69,.5); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 50px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked + span { background: #e0a800; }
.switch input:checked + span::after { transform: translateX(-22px); }
.switch input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.split { height: 12px; border-radius: 999px; background: #25d366; overflow: hidden; }
.split i { display: block; height: 100%; background: var(--grad); }
.split-legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.split-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; }
.split-legend .dot.a { background: var(--blue-2); }
.split-legend .dot.b { background: #25d366; }
.hbar { height: 8px; border-radius: 999px; background: rgba(120,175,255,.08); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.side { overflow-y: auto; }
.side-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(2,6,18,.72); animation: fade .25s; }
@media (max-width: 1000px) { .side { background: #081026; } }

/* ===== واجهة المتجر وبوابات الدفع ===== */
.bi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bi-row textarea.input { min-height: 80px; }
.field.bi { margin-bottom: 12px; }
.sf-tabs { margin-bottom: 16px; position: sticky; top: 0; z-index: 5; padding: 8px 0; background: #050a1c; }
.tick-list { display: grid; gap: 8px; }
.tick-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; }
.tick-row .input { height: 42px; font-size: 14px; }
.tick-row .icon-btn { width: 38px; height: 38px; font-size: 12px; }
.list-edit { padding: 14px; margin-bottom: 10px; position: relative; }
.list-edit > .btn-danger { margin-top: 4px; }
.sec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sec-item { padding: 12px 14px; border-radius: 12px; background: rgba(10,20,50,.5); border: 1px solid var(--line); }
.stat-row { align-items: end; margin-bottom: 6px; }
.gw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gw-head h2 { margin: 0 !important; }
.panel.gw.on { border-color: rgba(140,214,42,.45); }
.gw-urls { display: grid; gap: 8px; margin-top: 14px; }
.gw-urls > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: rgba(10,20,50,.5); border: 1px solid var(--line); }
.gw-urls small { width: 100%; color: var(--dim); }
.gw-urls code { flex: 1; min-width: 0; word-break: break-all; color: var(--lime-2); font-size: 13px; }
@media (max-width: 760px) {
  .bi-row, .tick-row { grid-template-columns: 1fr; }
  .sec-grid { grid-template-columns: 1fr 1fr; }
}
