:root {
  --bg: #f4f6f8; --card: #fff; --text: #1d2733; --muted: #5d6b7a; --line: #dde3ea;
  --primary: #0b6bcb; --primary-dark: #084f96;
  --ok: #1b7f3b; --ok-bg: #e3f5e8; --warn: #9a5b00; --warn-bg: #fff1d6; --bad: #b3261e; --bad-bg: #fde7e5;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro", "Droid Arabic Naskh", Arial, sans-serif;
}
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: .4rem 0 .8rem; }
h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
.page { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.topbar { background: #12304f; color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem; padding: .6rem 1rem; }
.topbar a { color: #fff; text-decoration: none; padding: .35rem .2rem; }
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.nav { display: flex; flex-wrap: wrap; gap: .2rem 1rem; align-items: center; }
.nav a:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; color: #fff; font: inherit; cursor: pointer; padding: .35rem .2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
.card.narrow, section.narrow { max-width: 440px; margin: 2rem auto; }
.muted, .hint { color: var(--muted); font-size: .92rem; }
label { display: block; font-weight: 600; margin: .7rem 0 .25rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #b9c3cf; border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #8fc0f5; outline-offset: 1px; }
input[type=checkbox] { width: auto; margin-inline-end: .4rem; transform: scale(1.3); }
.check-label { display: flex; align-items: center; font-weight: 600; }
.btn {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; text-align: center; cursor: pointer;
  padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid #b9c3cf; background: #fff; color: var(--text); min-height: 44px;
}
.btn:hover { background: #eef2f6; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.small { padding: .3rem .7rem; min-height: 36px; font-size: .9rem; }
.btn.block { width: 100%; margin-top: 1rem; }
.btn.xl { font-size: 1.3rem; padding: .9rem 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; }
.actions.sticky { position: sticky; bottom: 0; background: var(--card); padding: .6rem 0; border-top: 1px solid var(--line); }
.flash { border-radius: 8px; padding: .6rem .9rem; margin: 0 0 .8rem; border: 1px solid; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok); color: #0f5a28; }
.flash-error { background: var(--bad-bg); border-color: var(--bad); color: #7d1913; }
.flash-warn, .flash-info { background: var(--warn-bg); border-color: #e0a73a; color: #6b4000; }
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; border: 1px solid; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: #e0a73a; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; }
.grid { display: grid; gap: .8rem; margin: 0 0 1rem; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.cards.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line); border-inline-start: 6px solid #7f8da0; border-radius: var(--radius); padding: .9rem 1rem; }
.stat:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.stat .label { display: block; font-weight: 600; color: var(--muted); }
.stat .value { display: block; font-size: 2.2rem; font-weight: 800; line-height: 1.2; }
.stat .sub { display: block; color: var(--muted); font-weight: 600; margin-bottom: .3rem; }
.tone-ok { border-inline-start-color: var(--ok); }
.tone-warn { border-inline-start-color: #e08e00; }
.tone-bad { border-inline-start-color: var(--bad); }
.tone-warn-border { border-color: #e08e00; }
.card.user-stats { border-inline-start: 6px solid var(--ok); }
.user-stats-row { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; }
.user-stat .label { display: block; font-weight: 600; color: var(--muted); }
.user-stat .value { display: block; font-size: 2.2rem; font-weight: 800; line-height: 1.2; }
.bar { height: 10px; background: #e6ebf0; border-radius: 999px; overflow: hidden; }
.bar.big { height: 22px; }
.bar .fill { display: block; height: 100%; border-radius: 999px; }
.fill.ok { background: var(--ok); } .fill.warn { background: #e08e00; } .fill.bad { background: var(--bad); }
.progress-head { display: flex; justify-content: space-between; margin-bottom: .4rem; font-size: 1.1rem; }
.pcell { min-width: 140px; } .pcell span { display: block; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; align-items: end; }
.filters .f-search { grid-column: 1 / -1; }
.filters .f-go { display: flex; gap: .5rem; }
.rows { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.rows li.empty { padding: 1rem; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); }
.row { display: flex; align-items: center; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .7rem; text-decoration: none; color: var(--text); }
.row:hover { border-color: var(--primary); }
.row .names { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row .names strong, .row .en { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .en, .row .meta { color: var(--muted); font-size: .88rem; }
.thumb { width: 56px; height: 56px; flex: none; border-radius: 8px; background: #eef2f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.noimg { font-size: .7rem; color: var(--muted); text-align: center; padding: 2px; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
.item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .8rem; }
.item-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .item-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.ro { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .4rem 1rem; margin: 0; }
.ro dt { color: var(--muted); font-size: .85rem; } .ro dd { margin: 0; font-weight: 600; word-break: break-word; }
.helpers { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 0; }
.field.has-error input, .field.has-error textarea { border-color: var(--bad); }
.err { color: var(--bad); font-weight: 600; font-size: .9rem; }
.conflict-note { color: var(--warn); font-size: .9rem; }
.check { list-style: none; padding: 0; margin: 0; }
.check li { padding: .25rem 0; }
.check .mark { display: inline-block; min-width: 4.2rem; text-align: center; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 0 .5rem; border: 1px solid; }
.check .miss .mark { color: var(--bad); background: var(--bad-bg); border-color: var(--bad); }
.check .done .mark { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
.imgs { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.imgs li { border: 1px solid var(--line); border-radius: 10px; padding: .4rem; text-align: center; }
.imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.img-actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; margin-top: .3rem; }
.img-actions form { margin: 0; }
.upload { display: flex; flex-wrap: wrap; gap: .6rem; }
.upload .hint { flex-basis: 100%; margin: 0; }
.file-btn { cursor: pointer; margin: 0; }
.history { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.history li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.history .ts { color: var(--muted); } .history .old { color: var(--muted); }
.row-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; align-items: end; }
.inline-form { display: flex; gap: .4rem; } .inline-form input { min-width: 110px; }
.busy { opacity: .6; pointer-events: none; }
/* generated width classes */
.w-0{width:0%}
.w-1{width:1%}
.w-2{width:2%}
.w-3{width:3%}
.w-4{width:4%}
.w-5{width:5%}
.w-6{width:6%}
.w-7{width:7%}
.w-8{width:8%}
.w-9{width:9%}
.w-10{width:10%}
.w-11{width:11%}
.w-12{width:12%}
.w-13{width:13%}
.w-14{width:14%}
.w-15{width:15%}
.w-16{width:16%}
.w-17{width:17%}
.w-18{width:18%}
.w-19{width:19%}
.w-20{width:20%}
.w-21{width:21%}
.w-22{width:22%}
.w-23{width:23%}
.w-24{width:24%}
.w-25{width:25%}
.w-26{width:26%}
.w-27{width:27%}
.w-28{width:28%}
.w-29{width:29%}
.w-30{width:30%}
.w-31{width:31%}
.w-32{width:32%}
.w-33{width:33%}
.w-34{width:34%}
.w-35{width:35%}
.w-36{width:36%}
.w-37{width:37%}
.w-38{width:38%}
.w-39{width:39%}
.w-40{width:40%}
.w-41{width:41%}
.w-42{width:42%}
.w-43{width:43%}
.w-44{width:44%}
.w-45{width:45%}
.w-46{width:46%}
.w-47{width:47%}
.w-48{width:48%}
.w-49{width:49%}
.w-50{width:50%}
.w-51{width:51%}
.w-52{width:52%}
.w-53{width:53%}
.w-54{width:54%}
.w-55{width:55%}
.w-56{width:56%}
.w-57{width:57%}
.w-58{width:58%}
.w-59{width:59%}
.w-60{width:60%}
.w-61{width:61%}
.w-62{width:62%}
.w-63{width:63%}
.w-64{width:64%}
.w-65{width:65%}
.w-66{width:66%}
.w-67{width:67%}
.w-68{width:68%}
.w-69{width:69%}
.w-70{width:70%}
.w-71{width:71%}
.w-72{width:72%}
.w-73{width:73%}
.w-74{width:74%}
.w-75{width:75%}
.w-76{width:76%}
.w-77{width:77%}
.w-78{width:78%}
.w-79{width:79%}
.w-80{width:80%}
.w-81{width:81%}
.w-82{width:82%}
.w-83{width:83%}
.w-84{width:84%}
.w-85{width:85%}
.w-86{width:86%}
.w-87{width:87%}
.w-88{width:88%}
.w-89{width:89%}
.w-90{width:90%}
.w-91{width:91%}
.w-92{width:92%}
.w-93{width:93%}
.w-94{width:94%}
.w-95{width:95%}
.w-96{width:96%}
.w-97{width:97%}
.w-98{width:98%}
.w-99{width:99%}
.w-100{width:100%}
