/* Aloustol Alahlia — CMS admin */
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(../css/fonts/poppins-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Poppins; font-weight: 500; font-display: swap; src: url(../css/fonts/poppins-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(../css/fonts/poppins-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-weight: 400; font-display: swap; src: url(../css/fonts/cairo-arabic-400-normal.woff2) format('woff2'); }
@font-face { font-family: Cairo; font-weight: 600; font-display: swap; src: url(../css/fonts/cairo-arabic-600-normal.woff2) format('woff2'); }

:root {
  --navy: #0B2D6B; --navy-900: #061A40; --navy-800: #082356; --navy-500: #1A4FB0;
  --orange: #F26A1B; --orange-d: #D9560C; --sky: #2E8AE6;
  --ink: #1d2433; --muted: #6b7385; --line: #e4e8f0; --bg: #f4f6fa; --card: #fff;
  --ok: #047857; --ok-bg: #ecfdf5; --err: #b91c1c; --err-bg: #fef2f2;
  --r: 12px; --shadow: 0 1px 2px rgba(6,26,64,.06), 0 4px 16px rgba(6,26,64,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.55 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--navy-500); text-decoration: none; }
a:hover { color: var(--orange); }
h1, h2, h3 { color: var(--navy-900); margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
img { max-width: 100%; }
[dir=rtl], .ar { font-family: Cairo, Tahoma, sans-serif; }

/* layout */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--navy-900); color: rgba(255,255,255,.72); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.side .brand img { height: 30px; background: #fff; border-radius: 8px; padding: 4px 8px; }
.side .brand span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--orange); font-weight: 600; }
.side nav { padding: 6px 10px 20px; flex: 1; }
.side .grp { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.38); margin: 18px 10px 6px; font-weight: 600; }
.side a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.78); padding: 8px 10px; border-radius: 9px; font-size: 13.5px; }
.side a svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.side a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.on { background: rgba(242,106,27,.16); color: #fff; }
.side a.on svg { color: var(--orange); opacity: 1; }
.side a .pill { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 0 7px; line-height: 19px; }
.side .sub a { padding-left: 37px; font-size: 13px; }
.side .me { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 18px; font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side .me a { padding: 4px 8px; font-size: 12.5px; }
.main { min-width: 0; }
.top { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.top .crumb { color: var(--muted); font-size: 13px; }
.top .crumb b { color: var(--navy-900); font-weight: 600; }
.top .acts { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
.content { padding: 26px 28px 80px; max-width: 1180px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.grid > .card + .card { margin-top: 0; }
.ico { width: 15px; height: 15px; vertical-align: -2px; }
.card-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card-b { padding: 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.stat .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: rgba(242,106,27,.1); color: var(--orange); flex: none; }
.stat .ic svg { width: 20px; height: 20px; }
.stat b { display: block; font-size: 22px; color: var(--navy-900); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tile { display: block; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; background: #fff; color: var(--ink); transition: .15s; }
.tile:hover { border-color: var(--orange); color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.tile b { display: block; color: var(--navy-900); font-weight: 600; }
.tile small { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font: inherit; font-weight: 500; font-size: 13.5px; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: .15s; text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-p { background: var(--orange); color: #fff; }
.btn-p:hover { background: var(--orange-d); color: #fff; }
.btn-n { background: var(--navy); color: #fff; }
.btn-n:hover { background: var(--navy-800); color: #fff; }
.btn-l { background: #fff; color: var(--navy-900); border-color: var(--line); }
.btn-l:hover { border-color: #c9d0dd; color: var(--navy-900); background: #fafbfd; }
.btn-d { background: #fff; color: var(--err); border-color: #f3c9c9; }
.btn-d:hover { background: var(--err-bg); color: var(--err); }
.btn-s { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; padding: 0; }

/* forms */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 13px; color: var(--navy-900); margin-bottom: 6px; }
.lbl small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lang { position: relative; }
.lang > .tag { position: absolute; top: 8px; right: 9px; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: #8a93a6; background: #f1f3f8; border-radius: 5px; padding: 1px 6px; pointer-events: none; z-index: 1; }
.lang[dir=rtl] > .tag { right: auto; left: 9px; }
.lang input, .lang textarea { padding-right: 42px; }
.lang[dir=rtl] input, .lang[dir=rtl] textarea { padding-right: 12px; padding-left: 42px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; border: 1px solid #d5dbe6; border-radius: 9px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 42px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(46,138,230,.15); }
input[type=color] { width: 54px; height: 38px; padding: 3px; border: 1px solid #d5dbe6; border-radius: 9px; background: #fff; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--orange); }
.save-bar { position: sticky; bottom: 0; z-index: 15; margin-top: 20px; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; display: flex; gap: 10px; align-items: center; justify-content: flex-end; box-shadow: 0 -4px 20px rgba(6,26,64,.06); }
.save-bar .note { margin-right: auto; color: var(--muted); font-size: 12.5px; }
.save-bar .note.dirty { color: var(--orange-d); font-weight: 500; }
.counter { display: block; direction: ltr; text-align: right; font-size: 11px; color: var(--muted); margin-top: 3px; }
.counter.warn { color: var(--orange-d); }

/* image field */
.img-field { display: flex; gap: 14px; align-items: flex-start; }
.img-prev { width: 148px; height: 100px; border-radius: 10px; border: 1px solid var(--line); background: #f1f3f8 center/cover no-repeat; flex: none; display: grid; place-items: center; color: #a3abbb; overflow: hidden; }
.img-prev img { width: 100%; height: 100%; object-fit: contain; background: repeating-conic-gradient(#f3f4f8 0 25%, #fff 0 50%) 0 0/14px 14px; }
.img-prev.cover img { object-fit: cover; }
.img-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.img-side .row { display: flex; gap: 6px; flex-wrap: wrap; }
.img-side input[type=text] { font-size: 12px; color: var(--muted); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* icon field */
.icon-field { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.icon-prev { width: 46px; height: 46px; border-radius: 11px; background: rgba(242,106,27,.1); color: var(--orange); display: grid; place-items: center; flex: none; }
.icon-prev svg { width: 22px; height: 22px; }
.icon-grid { display: none; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; width: 100%; }
.icon-grid.open { display: grid; }
.icon-grid button { width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--navy); }
.icon-grid button:hover, .icon-grid button.sel { border-color: var(--orange); color: var(--orange); }
.icon-grid button svg { width: 20px; height: 20px; }
.icon-code { display: none; width: 100%; margin-top: 8px; font: 12px/1.4 ui-monospace, Menlo, monospace; }
.icon-code.open { display: block; }

/* tables / lists */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fbfcfe; }
.tbl .thumb { width: 64px; height: 44px; border-radius: 7px; object-fit: cover; background: #f1f3f8; display: block; }
.tbl .ic { width: 36px; height: 36px; border-radius: 9px; background: rgba(242,106,27,.1); color: var(--orange); display: grid; place-items: center; }
.tbl .ic svg { width: 18px; height: 18px; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts form { display: inline; }
.tbl .t-ar { color: var(--muted); font-size: 12.5px; font-family: Cairo, sans-serif; }
.handle { cursor: grab; color: #b3bbc9; width: 28px; text-align: center; user-select: none; }
.handle svg { width: 16px; height: 16px; }
tr.dragging td { background: #fff7f1 !important; opacity: .7; }
tr.drop-above td { box-shadow: inset 0 2px 0 var(--orange); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 2px 9px; background: #eef1f6; color: var(--muted); }
.badge.on { background: var(--ok-bg); color: var(--ok); }
.badge.new { background: rgba(242,106,27,.12); color: var(--orange-d); }
.badge.off { background: #f3f4f6; color: #8a93a6; }
.unread td { font-weight: 600; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; }
.tabs a:hover { color: var(--navy-900); }
.tabs a.on { color: var(--navy-900); border-color: var(--orange); }
.sec-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.sec-nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; }
.sec-nav a:hover, .sec-nav a.on { background: #fff; color: var(--navy-900); }
.with-nav { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: start; }

/* alerts */
.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #a7f3d0; }
.alert-err { background: var(--err-bg); color: var(--err); border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e4fa0; border: 1px solid #c7dcfb; }

/* media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.m-item { background: #fff; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; display: flex; flex-direction: column; }
.m-item .m-img { aspect-ratio: 4/3; background: repeating-conic-gradient(#f3f4f8 0 25%, #fff 0 50%) 0 0/14px 14px; display: grid; place-items: center; overflow: hidden; }
.m-item .m-img img { width: 100%; height: 100%; object-fit: cover; }
.m-item .m-meta { padding: 8px 10px; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.m-item .m-meta b { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-item .m-acts { display: flex; gap: 4px; }
.picker .m-item { cursor: pointer; transition: .12s; }
.picker .m-item:hover { border-color: var(--orange); transform: translateY(-1px); }
.drop { border: 2px dashed #cdd5e2; border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); background: #fafbfd; transition: .15s; }
.drop.over { border-color: var(--orange); background: #fff7f1; }

/* gallery */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gal-item { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.gal-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gal-item .gb { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.gal-item.removed { opacity: .4; }
.gal-item input { font-size: 12.5px; padding: 7px 10px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(6,26,64,.55); z-index: 100; display: none; align-items: center; justify-content: center; padding: 30px; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 14px; width: min(1000px, 100%); height: min(720px, 100%); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-box .card-h { flex: none; }
.modal-box iframe { border: 0; flex: 1; width: 100%; }

/* message */
.msg-meta { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; }
.msg-meta dt { color: var(--muted); }
.msg-meta dd { margin: 0; font-weight: 500; }
.msg-body { white-space: pre-wrap; background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 16px; line-height: 1.7; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--navy-900) radial-gradient(circle at 20% 10%, rgba(46,138,230,.25), transparent 40%), radial-gradient(circle at 90% 90%, rgba(242,106,27,.2), transparent 40%); }
.auth .card { width: min(420px, 100%); padding: 34px; border: 0; }
.auth .logo { display: block; height: 44px; margin: 0 auto 22px; }
.auth h1 { text-align: center; font-size: 19px; }
.auth p.sub { text-align: center; color: var(--muted); margin: 6px 0 24px; }
.pager { display: flex; gap: 6px; justify-content: center; padding: 16px; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }
.right { text-align: right; }
.code { font: 12px ui-monospace, Menlo, monospace; background: #f1f3f8; border-radius: 6px; padding: 2px 6px; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.35); }
  .menu-btn { display: inline-flex; }
  .with-nav { grid-template-columns: 1fr; }
  .sec-nav { display: none; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .content { padding: 18px 14px 80px; }
  .top { padding: 0 14px; }
  .pair, .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .img-field { flex-direction: column; }
  .tbl .hide-sm { display: none; }
}
.lang[dir=rtl] .counter { text-align: left; }
