/* Grdlabs NEWS — واجهة الإدارة */
:root {
  --red: #c80505; --red-2: #a00404; --red-soft: #fdecec;
  --bg: #f5f4f2; --panel: #ffffff; --panel-2: #faf9f7; --ink: #1a1514; --ink-2: #625a57; --ink-3: #958c88; --line: #e7e3df;
  --ok: #138a4b; --warn: #b26b00;
  --r: 12px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --f: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121010; --panel: #1b1817; --panel-2: #221e1d; --ink: #f3efed; --ink-2: #b9b0ad; --ink-3: #8a817e; --line: #2f2a28; --red-soft: #3a1414; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3); color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f); font-size: 15px; line-height: 1.6; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }

/* أزرار وحقول */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 18px; background: var(--red); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--red-2); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink-3); background: var(--panel-2); }
.btn.sm { padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--line); }
label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], textarea, select {
  width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; color: var(--ink); font-weight: 400;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.8; }
input:focus, textarea:focus, select:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.hint { font-size: 12.5px; color: var(--ink-3); font-weight: 400; margin: 0; }

/* صفحة الدخول */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 80% 0%, color-mix(in srgb, var(--red) 12%, transparent), transparent 50%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card form { display: grid; gap: 16px; margin-top: 26px; }
.auth-card .btn { padding: 12px; margin-top: 6px; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand img { width: 52px; height: 52px; }
.auth-brand b { display: block; font-size: 24px; letter-spacing: -.3px; direction: ltr; text-align: right; }
.auth-brand b span { color: var(--red); }
.auth-brand small { color: var(--ink-3); font-size: 13.5px; }
.err { color: var(--red); font-weight: 600; min-height: 1.4em; margin: 12px 0 0; font-size: 14px; }

/* الهيكل */
.boot { padding: 80px; text-align: center; color: var(--ink-3); }
.top { position: sticky; top: 0; z-index: 30; background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.logo-gn { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 18px; direction: ltr; }
.logo-gn img { width: 34px; height: 34px; }
.logo-gn span { color: var(--red); }
.top .sp { flex: 1; }
.plat-pick { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 4px 4px 10px; }
.plat-pick img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.plat-pick select { border: 0; background: transparent; padding: 4px 6px; font-weight: 700; width: auto; max-width: 180px; }
.plat-pick b { padding: 2px 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.user-chip .av { width: 32px; height: 32px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-weight: 800; }
.tabs { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 700; color: var(--ink-2); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--red); }
.tabs button:hover { color: var(--ink); }
.main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card > .hint { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: grid; gap: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.sticky { position: sticky; top: 120px; }
.save-bar { position: sticky; bottom: 0; margin-top: 16px; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 700; opacity: 0; transition: .25s; z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--red); color: #fff; }

/* قائمة الأخبار */
.alist { display: grid; gap: 8px; }
.arow { display: grid; grid-template-columns: 28px 84px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.arow.drag { opacity: .4; }
.arow.over { border-color: var(--red); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 25%, transparent); }
.handle { cursor: grab; color: var(--ink-3); display: grid; gap: 2px; justify-items: center; user-select: none; font-size: 18px; line-height: 1; }
.handle button { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 0 4px; font-size: 12px; }
.handle button:hover { color: var(--red); }
.athumb { width: 84px; aspect-ratio: 16/10; border-radius: 8px; object-fit: cover; background: var(--panel-2); display: block; }
.athumb.ph { display: grid; place-items: center; color: var(--ink-3); font-size: 20px; }
.arow h3 { margin: 0; font-size: 15px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.arow .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-2); }
.pill.red { background: var(--red); color: #fff; border-color: var(--red); }
.pill.draft { color: var(--warn); }
.pos { font-weight: 800; color: var(--ink-3); font-size: 12px; }
.arow .acts { display: flex; gap: 6px; }
.empty { text-align: center; padding: 60px 16px; color: var(--ink-3); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r); }

/* المحرر */
.drawer-ov { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; }
.editor { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(720px, 100%); background: var(--bg); z-index: 61; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.2); }
.editor header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.editor header h2 { margin: 0; font-size: 17px; }
.editor .body { flex: 1; overflow: auto; padding: 20px; display: grid; gap: 16px; align-content: start; }
.editor footer { display: flex; gap: 10px; padding: 14px 20px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.editor footer .sp { flex: 1; }
.title-in { font-size: 20px !important; font-weight: 700 !important; }

/* رفع الملفات */
.drop { position: relative; border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--panel); padding: 16px; display: grid; gap: 8px; justify-items: center; text-align: center; color: var(--ink-2); cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .ico { font-size: 22px; }
.drop small { color: var(--ink-3); }
.img-prev { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.img-prev img, .img-prev video { width: 100%; display: block; max-height: 300px; object-fit: cover; }
.img-prev .x { position: absolute; top: 8px; inset-inline-start: 8px; }
.prog { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; width: 100%; }
.prog i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }

/* الهوية */
.logo-box { display: grid; gap: 10px; }
.logo-show { height: 120px; border-radius: var(--r); border: 1px solid var(--line); display: grid; place-items: center; padding: 16px; position: relative; }
.logo-show img { max-height: 88px; max-width: 80%; object-fit: contain; }
.logo-show.dark { background: #15110f; border-color: #15110f; }
.logo-show.light { background: #fff; }
.logo-show .none { color: #9a918d; font-size: 13px; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.color-in { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--panel); }
.color-in input[type=color] { width: 38px; height: 38px; border: 0; padding: 0; background: none; border-radius: 8px; cursor: pointer; flex: none; }
.color-in input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-in input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.1); border-radius: 8px; }
.color-in div { display: grid; min-width: 0; }
.color-in b { font-size: 13px; color: var(--ink); }
.color-in input[type=text] { border: 0; padding: 0; background: none; font-size: 12.5px; color: var(--ink-3); direction: ltr; text-align: right; font-family: ui-monospace, monospace; box-shadow: none !important; }
.fonts { display: grid; gap: 8px; }
.font-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.font-row .w { font-weight: 700; font-size: 13.5px; }
.font-row .w small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12px; }
.font-row .sample { font-family: "BrandFont", var(--f); font-size: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.font-row .sample.none { color: var(--ink-3); font-size: 13px; font-family: var(--f); }
.font-row .acts { display: flex; gap: 6px; }
.font-row .up { position: relative; overflow: hidden; }
.font-row .up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* معاينة الهوية */
.bprev { border-radius: 14px; overflow: hidden; aspect-ratio: 4/5; position: relative; color: #fff; font-family: "BrandFont", var(--f); display: flex; flex-direction: column; }
.bprev .ph { position: absolute; inset: 0; background-size: cover; background-position: center; }
.bprev .ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--p-ink) 18%, transparent 70%); }
.bprev .tp { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 16px; }
.bprev .tp img { height: 30px; max-width: 120px; object-fit: contain; }
.bprev .tp span { font-size: 11px; direction: ltr; opacity: .85; }
.bprev .gr { flex: 1; }
.bprev .urg { position: relative; align-self: flex-start; margin: 0 16px 10px; background: var(--p-urgent); padding: 3px 12px 5px; font-weight: 800; font-size: 14px; }
.bprev h4 { position: relative; margin: 0 16px; font-size: 22px; line-height: 1.45; font-weight: 800; }
.bprev h4 em { font-style: normal; color: var(--p-hl); }
.bprev .ft { position: relative; display: flex; justify-content: space-between; padding: 12px 16px 18px; font-size: 11px; opacity: .8; }
.bprev .gl { position: relative; height: 6px; background: var(--p-grad); }
.prev-modes { display: flex; gap: 6px; margin-top: 10px; }
.prev-modes span { flex: 1; height: 30px; border-radius: 8px; border: 1px solid var(--line); }

/* الملفات والجداول */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.table th { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }
.table td.num { direction: ltr; text-align: right; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.table .acts { display: flex; gap: 6px; justify-content: flex-end; }
.plat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.plat-card { display: grid; gap: 10px; }
.plat-card .hd { display: flex; align-items: center; gap: 12px; }
.plat-card .hd img, .plat-card .hd .ph { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--red); }
.plat-card .hd b { display: block; font-size: 16px; }
.plat-card .hd small { color: var(--ink-3); direction: ltr; display: block; text-align: right; }
.plat-card .st { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.plat-card .acts { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 700px) {
  .grid2, .grid3, .colors { grid-template-columns: 1fr; }
  .arow { grid-template-columns: 24px 64px minmax(0, 1fr); }
  .athumb { width: 64px; }
  .arow .acts { grid-column: 1 / -1; justify-content: flex-end; }
  .user-chip span { display: none; }
  .font-row { grid-template-columns: 1fr auto; }
  .font-row .sample { grid-column: 1 / -1; grid-row: 2; }
  .logo-gn b { display: none; }
}

/* v1.1: نظرة عامة، فلترة، تغطية مباشرة */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.stat span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.stat b { font-size: 30px; line-height: 1.2; letter-spacing: -.5px; }
.stat small { color: var(--ink-3); font-size: 12.5px; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 190px; margin-top: 14px; direction: ltr; }
.bar { height: 100%; display: grid; grid-template-rows: 1fr auto; gap: 6px; }
.bar span { align-self: end; display: block; background: color-mix(in srgb, var(--red) 30%, var(--panel)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar.today span { background: var(--red); }
.bar small { font-size: 10.5px; color: var(--ink-3); text-align: center; height: 14px; }
.top-list { list-style: none; counter-reset: t; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.top-list li { counter-increment: t; display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.top-list li:last-child { border-bottom: 0; }
.top-list li::before { content: counter(t); font-weight: 800; color: var(--red); text-align: center; }
.top-list a { text-decoration: none; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.top-list a:hover { color: var(--red); }
.top-list span { color: var(--ink-3); font-size: 13px; font-weight: 700; }
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 200px; max-width: 360px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.chips button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.alist.filtered .handle { visibility: hidden; }
.pill.sched { color: #2563eb; }
.live-panel { border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: var(--r); background: var(--panel); padding: 16px; display: grid; gap: 10px; }
.live-panel h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.live-panel h3 .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: gnpulse 1.4s infinite; }
@keyframes gnpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.live-add { display: grid; gap: 8px; }
.live-add textarea { min-height: 64px; }
.live-add-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.live-list li { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.live-list li time { color: var(--red); font-weight: 700; font-size: 12.5px; }
.live-list li p { margin: 0; }
.live-list li.imp p { color: var(--red); font-weight: 700; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; } }

/* =====================================================================
   v1.2 — التصميم الجديد: إطار زجاجي، شريط أيقونات أسود، بطاقات كبيرة مدوّرة
   ===================================================================== */
:root {
  --bg: #e7e8ea; --frame: rgba(248,248,249,.78); --panel: #ffffff; --panel-2: #f2f3f5; --line: #e6e7ea; --line-2: #dfe1e5;
  --ink: #111214; --ink-2: #5d6168; --ink-3: #9a9ea6; --accent: var(--red);
  --c-blue: #a9d9f8; --c-green: #c2ef8e; --c-orange: #fbb48f; --c-purple: #d6c6fb;
  --r: 22px; --r-lg: 30px; --shadow: 0 1px 1px rgba(0,0,0,.02), 0 10px 30px rgba(17,18,20,.05);
  --f: "IBM Plex Sans Arabic", "SF Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0f11; --frame: rgba(24,25,28,.85); --panel: #17181b; --panel-2: #202125; --line: #2a2c31; --line-2: #34363c; --ink: #f2f3f5; --ink-2: #b3b7be; --ink-3: #7d828b; --red-soft: #3a1414; }
}
body { background: radial-gradient(1200px 600px at 100% -10%, #f6f6f7 0%, transparent 60%), var(--bg); min-height: 100vh; font-size: 15px; }
@media (prefers-color-scheme: dark) { body { background: var(--bg); } }
.btn { border-radius: 999px; padding: 10px 20px; font-weight: 600; }
.btn.ghost { background: var(--panel); border-color: var(--line); }
.btn.ok { background: #138a4b; } .btn.ok:hover { background: #0f7540; }
.btn.sm { border-radius: 999px; padding: 6px 14px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=datetime-local], textarea, select { border-radius: 14px; background: var(--panel-2); border-color: transparent; padding: 11px 14px; }
input:focus, textarea:focus, select:focus { background: var(--panel); }

/* الإطار */
.frame { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 22px; max-width: 1440px; margin: 20px auto; padding: 22px; background: var(--frame); border: 1px solid rgba(255,255,255,.9); border-radius: 44px; backdrop-filter: blur(20px); min-height: calc(100vh - 40px); box-shadow: 0 30px 80px rgba(17,18,20,.06); }
@media (prefers-color-scheme: dark) { .frame { border-color: var(--line); } }
.rail { position: sticky; top: 42px; align-self: start; height: calc(100vh - 84px); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.rail-logo { width: 68px; height: 68px; border-radius: 50%; background: var(--red); display: grid; place-items: center; box-shadow: 0 8px 24px color-mix(in srgb, var(--red) 35%, transparent); flex: none; }
.rail-logo svg { width: 38px; height: 38px; }
.rail-nav { background: #0f1012; border-radius: 999px; padding: 10px; display: flex; flex-direction: column; gap: 10px; align-items: center; overflow-y: auto; scrollbar-width: none; max-height: 100%; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-nav button, .rail-me { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; background: #2b2d31; color: #e9eaec; display: grid; place-items: center; cursor: pointer; flex: none; transition: background .15s, color .15s, transform .15s; }
.rail-nav button svg { width: 22px; height: 22px; }
.rail-nav button:hover:not(:disabled) { background: #3a3d42; }
.rail-nav button.on { background: #fff; color: #0f1012; }
.rail-nav button:disabled { opacity: .35; cursor: not-allowed; }
.rail-nav button span { position: absolute; inset-inline-start: calc(100% + 12px); top: 50%; transform: translateY(-50%); background: #0f1012; color: #fff; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 10px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 50; }
.rail-nav button:hover span, .rail-nav button:focus-visible span { opacity: 1; }
.rail-nav .badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.rail-sep { width: 26px; height: 1px; background: #34363b; flex: none; margin: 6px 0; }
.rail-me { margin-top: auto; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); width: 60px; height: 60px; }
.rail-me.on { outline: 2px solid var(--ink); }
.rail-me .av { width: 40px; height: 40px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-weight: 800; font-size: 17px; }
.content { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar .sp { flex: 1; }
.search-pill { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 999px; padding: 0 18px; height: 54px; width: min(360px, 100%); box-shadow: var(--shadow); color: var(--ink-2); cursor: text; }
.search-pill svg { width: 20px; height: 20px; flex: none; }
.search-pill input { border: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; font-size: 15.5px; flex: 1; min-width: 0; }
.plat-pick { background: var(--panel); border: 0; border-radius: 999px; height: 54px; padding: 6px 8px 6px 16px; box-shadow: var(--shadow); }
.plat-pick img, .plat-pick .pl-ph { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; background: var(--panel-2); padding: 4px; display: grid; place-items: center; font-weight: 800; color: var(--red); }
.topbar .btn { height: 54px; padding: 0 24px; box-shadow: var(--shadow); }
.banner { background: #fff4e5; color: #8a4b00; border-radius: 18px; padding: 12px 20px; font-weight: 600; }
.banner a { color: inherit; }
.main { max-width: none; margin: 0; padding: 0 0 40px; }
.tabs, .top { display: none; }

/* البطاقات */
.card { border: 0; border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 18px; font-weight: 600; }
.card.big h1, .page-head h1 { font-size: 34px; font-weight: 500; letter-spacing: -.5px; margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head { margin: 4px 4px 20px; }
.page-head p { font-size: 15px; }
.card.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff7ed; }
@media (prefers-color-scheme: dark) { .card.notice { background: #2a1d10; } .banner { background: #2a1d10; color: #f5c27a; } }
.card.notice b { font-size: 16px; }
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.sub { background: var(--panel-2); border-radius: 26px; padding: 24px 26px; min-width: 0; }
.sub h3 { margin: 0 0 16px; font-size: 18px; font-weight: 500; }
.sub.today { display: grid; grid-template-columns: 1fr 170px; gap: 18px; align-items: center; }
.kv dl { margin: 0; display: grid; }
.kv dl div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv dl div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; font-weight: 600; }
.donut { position: relative; width: 170px; aspect-ratio: 1; }
.donut svg { width: 100%; height: 100%; }
.donut div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut b { font-size: 28px; font-weight: 600; letter-spacing: -.5px; }
.donut small { color: var(--ink-3); font-size: 12px; }
.wbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 168px; }
.wb { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; text-align: center; min-width: 0; }
.wb small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; }
.wb b { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.wb .track { position: relative; border-radius: 8px; background: repeating-linear-gradient(-45deg, transparent 0 5px, var(--line-2) 5px 7px); overflow: hidden; }
.wb .track span { position: absolute; bottom: 0; left: 0; right: 0; background: var(--c-blue); border-radius: 8px; }
.wb.today .track span { background: var(--accent); }
.wb.today small { color: var(--ink); font-weight: 700; }

/* الجداول بشكل التصميم */
.tbl-wrap { background: var(--panel-2); border-radius: 22px; padding: 6px; overflow-x: auto; }
.table { border-collapse: separate; border-spacing: 0; min-width: 640px; }
.table thead th { font-size: 13.5px; font-weight: 500; color: var(--ink-3); padding: 14px 16px; border: 0; }
.table tbody td { background: var(--panel); padding: 13px 16px; border: 0; border-top: 1px solid var(--panel-2); font-size: 14.5px; }
.table tbody tr:first-child td:first-child { border-start-start-radius: 16px; } .table tbody tr:first-child td:last-child { border-start-end-radius: 16px; }
.table tbody tr:last-child td:first-child { border-end-start-radius: 16px; } .table tbody tr:last-child td:last-child { border-end-end-radius: 16px; }
.table tr[data-open] { cursor: pointer; } .table tr[data-open]:hover td { background: #fafafb; }
@media (prefers-color-scheme: dark) { .table tr[data-open]:hover td { background: #1c1d21; } }
.table td.t { font-weight: 500; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 84px; padding: 4px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--panel-2); color: var(--ink-2); white-space: nowrap; }
.chip.c0 { background: var(--c-blue); color: #0d3550; } .chip.c1 { background: var(--c-green); color: #24410a; } .chip.c2 { background: var(--c-orange); color: #5a2209; } .chip.c3 { background: var(--c-purple); color: #2f1a63; }
.chip.warn { background: #ffe2b8; color: #6b3d00; } .chip.bad { background: #ffd2d2; color: #8a0b0b; } .chip.red { background: var(--red); color: #fff; }
.pill { border-radius: 999px; } .pill.warn { color: #9a5800; background: #fff1dc; border-color: #ffe2b8; } .pill.bad { color: #b00; background: #ffe5e5; border-color: #ffd2d2; }

/* الأقسام الموجودة بالشكل الجديد */
.stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { border: 0; border-radius: 26px; padding: 22px 24px; }
.stat b { font-size: 32px; font-weight: 600; }
.arow { border: 0; border-radius: 22px; padding: 12px 14px; box-shadow: var(--shadow); }
.athumb { border-radius: 14px; }
.filters input { border-radius: 999px; background: var(--panel); box-shadow: var(--shadow); }
.chips button { border: 0; background: var(--panel); box-shadow: var(--shadow); padding: 8px 16px; }
.empty { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.drop { border-radius: 22px; border-color: var(--line-2); }
.font-row, .color-in { border: 0; background: var(--panel-2); border-radius: 16px; }
.logo-show { border-radius: 20px; }
.top-list li { padding: 12px 0; }
.editor { width: min(760px, 100%); border-start-start-radius: 30px; border-end-start-radius: 30px; overflow: hidden; }
.editor.wide { width: min(1060px, 100%); }
.editor header, .editor footer { border-color: var(--line); }
.note-bad { background: #ffe5e5; color: #8a0b0b; border-radius: 16px; padding: 12px 16px; }
.toast { border-radius: 999px; }

/* القوالب الخاصة */
.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tpl-card { display: grid; gap: 8px; margin: 0 !important; }
.tpl-thumb { aspect-ratio: 4/5; border-radius: 18px; background: repeating-conic-gradient(var(--panel-2) 0 25%, var(--panel) 0 50%) 0 0/20px 20px; display: grid; place-items: center; overflow: hidden; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-ed { grid-template-columns: minmax(0, 1fr) 380px; display: grid; gap: 22px; align-items: start; }
.tpl-prev-wrap { position: sticky; top: 0; display: grid; gap: 12px; }
.tpl-prev { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #222; }
.tp-in { position: absolute; top: 0; left: 0; transform-origin: top left; background: #15161a; overflow: hidden; direction: rtl; }
.tp-ph { position: absolute; top: 0; left: 0; right: 0; background-size: cover; background-position: center; }
.tp-ph i { position: absolute; inset: 0; background: linear-gradient(0deg, #000, transparent 70%); }
.tp-fr { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tp-box { position: absolute; display: flex; flex-direction: column; justify-content: center; gap: 14px; font-family: "BrandFont", var(--f); }
.tp-t { font-weight: 800; line-height: 1.35; } .tp-k { font-weight: 700; font-size: 32px; opacity: .9; }
.frames { display: grid; gap: 8px; }
.frame-up { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--panel-2); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; }
.frame-up .up, .font-row .up { position: relative; overflow: hidden; }
.frame-up .up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.seg { display: flex; background: var(--panel-2); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 8px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* النشر */
.soc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.soc { display: grid; gap: 12px; align-content: start; margin: 0 !important; }
.soc .card-head { margin-bottom: 0; }
.steps { margin: 0; padding-inline-start: 18px; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 4px; }
.row-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 4px; }

/* الاشتراك والنوافذ */
.bill { display: flex; gap: 14px; align-items: center; }
.bill p { margin: 2px 0 0; }
.modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { width: min(480px, 100%); display: grid; gap: 14px; margin: 0 !important; }
.modal h2 { margin: 0; font-size: 20px; }

@media (max-width: 1100px) { .split, .soc-grid { grid-template-columns: 1fr; } .tpl-ed { grid-template-columns: 1fr; } .tpl-prev-wrap { position: static; } }
@media (max-width: 760px) {
  .frame { grid-template-columns: 1fr; margin: 0; padding: 12px 12px 96px; border-radius: 0; border: 0; min-height: 100vh; backdrop-filter: none; box-shadow: none; }
  .rail { position: fixed; top: auto; bottom: 10px; left: 10px; right: 10px; height: auto; flex-direction: row; z-index: 40; gap: 8px; }
  .rail-logo { display: none; }
  .rail-nav { flex-direction: row; flex: 1; overflow-x: auto; padding: 8px; }
  .rail-nav button { width: 46px; height: 46px; } .rail-nav button span { display: none; }
  .rail-sep { width: 1px; height: 24px; margin: 0 2px; }
  .rail-me { width: 62px; height: 62px; margin: 0; }
  .search-pill { width: 100%; height: 48px; } .topbar .btn, .plat-pick { height: 48px; }
  .card { padding: 20px; border-radius: 24px; } .card.big h1, .page-head h1 { font-size: 26px; }
  .sub.today { grid-template-columns: 1fr; justify-items: center; } .kv { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .editor { border-radius: 0; }
}
