/* لوحة تحكم بيت الحلول البرمجية — نفس ألوان الموقع */
@font-face { font-family: Cairo; src: url(fonts/cairo-arabic.woff2) format('woff2'); font-weight: 200 1000; font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: Cairo; src: url(fonts/cairo-latin.woff2) format('woff2'); font-weight: 200 1000; font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
	--main: #03a9f4; --main-alt: #0288d1; --soft: #e1f5fe; --dark: #191919; --ink: #1d2939; --muted: #667085;
	--line: #e4e7ec; --bg: #f5f8fb; --ok: #2e7d32; --err: #c62828; --warn: #ef6c00; --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Cairo, system-ui, Tahoma, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.7; font-size: 15px; }
a { color: var(--main-alt); }
h1 { font-size: 24px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 0 0 12px; }
code { background: #f2f4f7; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* الشريط العلوي */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: #fff; border-bottom: 3px solid var(--main); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { height: 40px; width: auto; }
.brand span { font-weight: 800; font-size: 17px; line-height: 1.2; display: flex; flex-direction: column; }
.brand small { font-weight: 600; font-size: 12px; color: var(--main); }
.top-end { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }
.site-link { text-decoration: none; font-weight: 700; }
.build { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #f2f4f7; color: var(--muted); }
.build.ok { background: #e8f5e9; color: var(--ok); }
.build.err { background: #ffebee; color: var(--err); }
.build.busy { background: var(--soft); color: var(--main-alt); }
.menu-btn { display: none; border: 0; background: var(--soft); color: var(--main-alt); font-size: 20px; border-radius: 8px; width: 40px; height: 40px; cursor: pointer; }

/* التخطيط */
.layout { display: flex; min-height: calc(100vh - 66px); }
.side { width: 230px; flex-shrink: 0; background: var(--dark); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.side a, .side summary, .side .link { display: block; color: #d0d5dd; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.side a:hover, .side summary:hover, .side .link:hover { background: #2b2b2b; color: #fff; }
.side a.on { background: var(--main); color: #fff; }
.side details a { padding-inline-start: 24px; font-size: 14px; }
.side .grp { color: #7d8794; font-size: 12px; padding: 14px 12px 4px; }
.side form { margin-top: auto; }
.side .link { width: 100%; text-align: start; background: none; border: 0; font: inherit; font-size: 13px; }
.badge { background: var(--warn); color: #fff; border-radius: 20px; padding: 0 8px; font-size: 12px; margin-inline-start: 6px; }
.main { flex: 1; padding: 24px; max-width: 1100px; min-width: 0; }

/* البطاقات */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 0 0 16px; }
fieldset.card { min-width: 0; }
legend { font-weight: 800; color: var(--main-alt); padding: 0 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cards .card { margin: 0; }
.stat span { color: var(--muted); font-weight: 600; display: block; }
.stat b { display: block; font-size: 32px; color: var(--main-alt); line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); }
.todo { margin: 0; padding-inline-start: 18px; }
.todo li { margin: 6px 0; }
.todo a { color: var(--ink); }

/* النماذج */
.stack > * + * { margin-top: 0; }
.field { display: block; font-weight: 700; margin: 0 0 14px; font-size: 14px; }
.field input:not([type=checkbox]), .field textarea, .field select, .login input {
	display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400; font-size: 16px;
	border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; color: var(--ink); }
.field textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field textarea:focus, .field select:focus, .login input:focus { outline: 0; border-color: var(--main); box-shadow: 0 0 0 3px #03a9f433; }
.field input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; margin-inline-start: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.check input { width: 20px; height: 20px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: end; }
.row-wrap .field { flex: 1 1 260px; margin: 0; }
.img-pick { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.img-pick select { margin-top: 0 !important; flex: 1; min-width: 0; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #f2f4f7; flex-shrink: 0; }
.thumb:not([src]) { visibility: hidden; }
.btn { background: var(--main); color: #fff; border: 0; border-radius: 8px; padding: 10px 26px; font: inherit; font-weight: 800; cursor: pointer; }
.btn:hover { background: var(--main-alt); }
.btn.ghost { background: var(--soft); color: var(--main-alt); }
.mini { background: #f2f4f7; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; }
.mini:hover { border-color: var(--main); }
.mini.danger { color: var(--err); }
.actions { display: flex; gap: 10px; justify-content: flex-end; }
.actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row form { display: inline; }

/* عناصر القوائم */
.item .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.item .grid .field:has(textarea) { grid-column: 1 / -1; }
.item-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.item-bar b { color: var(--main-alt); }
.spacer { flex: 1; }
.item.placeholder { border-color: #ffcc80; background: #fffaf2; }
.item.removing { opacity: .4; }
.tag { font-size: 12px; padding: 1px 10px; border-radius: 20px; background: #f2f4f7; color: var(--muted); }
.tag.warn { background: #fff3e0; color: var(--warn); }
.tag.ok { background: #e8f5e9; color: var(--ok); }
.tag.err { background: #ffebee; color: var(--err); }

/* تنبيهات */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: #e8f5e9; color: var(--ok); }
.flash.err { background: #ffebee; color: var(--err); }

/* جداول */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-size: 13px; }
.tbl tr.unread td { font-weight: 700; }
.clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-cell { width: 45%; }
progress { width: 100%; height: 10px; accent-color: var(--main); }

/* الرسائل */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs a, .pager a { padding: 6px 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.tabs a.on, .pager a.on { background: var(--main); color: #fff; border-color: var(--main); }
.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.msg header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.msg.unread { border-inline-start: 4px solid var(--main); }
.msg .body { white-space: pre-wrap; margin: 8px 0 12px; }
.contact-line { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0; }

/* الصور */
.upload .drop { display: block; border: 2px dashed #b3e5fc; background: var(--soft); border-radius: var(--r); padding: 18px; font-weight: 700; margin-bottom: 12px; }
.upload .drop input { display: block; margin-top: 10px; font: inherit; max-width: 100%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; padding: 8px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; background: #f2f4f7; display: block; }
.gallery figcaption { display: flex; flex-direction: column; gap: 4px; font-size: 12px; margin-top: 6px; word-break: break-all; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-top: 12px; }
.log { background: #111; color: #cfe; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; text-align: left; }
.narrow { max-width: 460px; }

/* الدخول */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--soft), #fff 60%); }
.login { width: 100%; max-width: 380px; text-align: center; border-top: 4px solid var(--main); }
.login img { height: 80px; width: auto; }
.login h1 { margin: 8px 0 0; font-size: 22px; }
.login label { display: block; text-align: start; font-weight: 700; margin: 12px 0; }
.login .btn { width: 100%; margin-top: 8px; padding: 12px; }

/* الموبايل */
@media (max-width: 860px) {
	.menu-btn { display: inline-block; }
	.side { position: fixed; top: 63px; bottom: 0; right: 0; z-index: 30; transform: translateX(100%); transition: transform .25s; overflow-y: auto; }
	.side.open { transform: none; box-shadow: -10px 0 30px #0004; }
	.main { padding: 16px; }
	.site-link { display: none; }
	.brand small { display: none; }
	.clip { max-width: 160px; }
	.bar-cell { width: 30%; }
}
