/* ===== منصة الرحاب — الأنماط العامة (RTL) ===== */
:root {
  --navy: #1c2b4a; --navy-2: #2b3f6b; --red: #a3201f; --red-2: #c93a34;
  --bg: #f4f5f8; --surface: #fff; --line: #e3e6ee; --text: #1d2433; --muted: #6b7488;
  --ok: #1f9d63; --warn: #d98e04; --danger: #c0392b;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,30,60,.06), 0 4px 14px rgba(20,30,60,.06);
  --font: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }

/* ---------- الشريط العلوي ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px; background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.tb-home { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; }
.tb-home:hover { background: rgba(255,255,255,.12); }
.tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.tb-brand img { width: 30px; height: 30px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.tb-sep { opacity: .4; }
.tb-crumb { opacity: .9; }
.tb-spacer { flex: 1; }
.rt-dot { width: 10px; height: 10px; border-radius: 50%; background: #8a94a6; box-shadow: 0 0 0 3px rgba(255,255,255,.12); transition: background .3s; }
.rt-dot.on { background: #3ddc97; }
.tb-user { position: relative; }
.tb-user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; color: #fff; padding: 4px 8px; border-radius: 10px; }
.tb-user-btn:hover { background: rgba(255,255,255,.12); }
.menu { position: absolute; inset-inline-end: 0; top: 46px; min-width: 230px; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 6px; z-index: 60; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; background: none; border: 0; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--bg); }
.menu-head { display: flex; flex-direction: column; padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head small { color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; flex: none; border: 2px solid rgba(255,255,255,.85); }
.avatar.has-img { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }
.avatar.xl { width: 120px; height: 120px; font-size: 40px; border: 4px solid #fff; box-shadow: var(--shadow); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; border-width: 2px; border-color: var(--surface); }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }

/* ---------- أزرار وحقول ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; transition: .15s; white-space: nowrap; }
.btn:hover { background: #f0f2f7; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-2); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-danger { background: #fff; border-color: #efc4c0; color: var(--danger); }
.btn-danger:hover { background: #fdeceb; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
.field small { color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(43,63,107,.14); }
textarea { resize: vertical; min-height: 80px; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--red); }
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fdeceb; color: #8f2118; border: 1px solid #f4c9c5; }
.alert-ok { background: #e7f6ee; color: #14683f; border: 1px solid #bfe6d1; }

/* ---------- المصادقة ---------- */
.auth-body { background: #f7f7f7; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 28px 28px 24px; }
.auth-logo { display: block; width: 78%; max-width: 280px; margin: 0 auto 8px; }
.auth-card h1 { text-align: center; font-size: 20px; margin: 4px 0 18px; color: var(--navy); }
.auth-note { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* ---------- شاشة التطبيقات ---------- */
.home { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
.home-hero { text-align: center; padding: 10px 0 26px; }
.home-logo { width: 220px; max-width: 60%; }
.home-hero h1 { margin: 6px 0 2px; color: var(--navy); font-size: 26px; }
.home-hero p { margin: 0; color: var(--muted); }
/* شاشة التطبيقات بأسلوب التابلت: أيقونات مدوّرة + اسم تحتها */
body.home-body { background: radial-gradient(900px 500px at 85% -10%, rgba(163,32,31,.10), transparent 60%), radial-gradient(800px 500px at 0% 0%, rgba(43,63,107,.12), transparent 60%), linear-gradient(180deg, #f3f5fa, #e8ecf5); background-attachment: fixed; min-height: 100vh; }
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 30px 14px; max-width: 760px; margin: 8px auto 0; padding: 26px 22px 30px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8); border-radius: 34px; box-shadow: 0 10px 40px rgba(28,43,74,.10); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.app { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; -webkit-tap-highlight-color: transparent; }
.app-ic { position: relative; width: 78px; height: 78px; border-radius: 23px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: 0 10px 22px -8px var(--c1), inset 0 1px 0 rgba(255,255,255,.35), inset 0 -3px 6px rgba(0,0,0,.12); transition: transform .18s cubic-bezier(.3,1.4,.5,1), box-shadow .18s; }
.app-ic::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.28), transparent 52%); pointer-events: none; }
.app-ic .ic { width: 38px; height: 38px; stroke-width: 1.8; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.app:hover .app-ic { transform: translateY(-4px) scale(1.06); box-shadow: 0 16px 28px -8px var(--c1), inset 0 1px 0 rgba(255,255,255,.35); }
.app:active .app-ic { transform: scale(.94); }
.app-name { font-size: 13.5px; font-weight: 600; color: var(--navy); line-height: 1.3; max-width: 112px; }
.app-badge { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: #e53935; color: #fff; font: 700 12.5px/24px var(--font); font-style: normal; text-align: center; border: 2.5px solid #eef1f8; }
.app-badge[hidden] { display: none; }
/* شاشة التطبيقات مقسَّمة إلى مجموعات */
.groups { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; max-width: 1060px; margin: 8px auto 0; }
.group { flex: 1 1 280px; max-width: 520px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8); border-radius: 28px; box-shadow: 0 10px 40px rgba(28,43,74,.10); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 18px 16px 22px; }
.group-title { margin: 0 6px 14px; font-size: 15px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(28,43,74,.18), transparent); }
.group .launcher { max-width: none; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 22px 10px; }
@media (max-width: 520px) { .groups { gap: 14px; } .group { flex-basis: 100%; max-width: none; padding: 16px 12px 18px; } .group .launcher { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .launcher { grid-template-columns: repeat(3, 1fr); padding: 20px 12px; border-radius: 26px; } .app-ic { width: 68px; height: 68px; border-radius: 20px; } }
.tile-ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: #fff; margin-bottom: 8px; }
.tile-ic .ic { width: 30px; height: 30px; }
.empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.empty .ic { width: 42px; height: 42px; opacity: .5; }
.center-msg { text-align: center; padding: 80px 16px; }

/* ---------- عام: نوافذ وتنبيهات ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(18,26,48,.5); display: grid; place-items: center; padding: 16px; animation: fade .15s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); width: 100%; max-width: 480px; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; max-height: calc(100vh - 32px); animation: pop .18s; }
.modal.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; color: var(--navy); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 16px 16px; }
.modal-foot .spacer { flex: 1; }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: pop .2s; font-size: 14px; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
.toast button { background: rgba(255,255,255,.18); border: 0; color: #fff; border-radius: 8px; padding: 4px 10px; font-weight: 600; }
.toast button:hover { background: rgba(255,255,255,.3); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #eef0f6; color: var(--navy); }
.badge.red { background: #fbe7e5; color: var(--red); }
.badge.green { background: #e1f4ea; color: #14683f; }
.badge.amber { background: #fdf1d6; color: #8a5a00; }
.badge.gray { background: #eceef3; color: var(--muted); }

/* ---------- صفحة الأدمن ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; color: var(--navy); }
.page-head .spacer { flex: 1; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12px; color: var(--muted); font-weight: 600; padding: 11px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.off td { opacity: .55; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { border-color: transparent; width: 36px; height: 36px; font-size: 13px; }
.user-cell small { color: var(--muted); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.perm-row .tile-ic { width: 36px; height: 36px; border-radius: 10px; margin: 0; }
.perm-row .tile-ic .ic { width: 20px; height: 20px; }
.perm-row b { flex: 1; }
.perm-row select { width: 150px; }
.pw-row { display: flex; gap: 8px; } .pw-row input { flex: 1; }

/* ---------- To-Do: قائمة اللوحات ---------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bcard { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid transparent; transition: .15s; position: relative; }
.bcard:hover { transform: translateY(-2px); border-color: var(--line); }
.bcard.today { border-color: #e9b5b1; box-shadow: 0 0 0 3px rgba(163,32,31,.08), var(--shadow); }
.bcard h3 { margin: 0; font-size: 16px; color: var(--navy); }
.bcard .sub { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.bar { height: 8px; background: #eceef3; border-radius: 8px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #4cc58b); border-radius: 8px; transition: width .4s; }
.bcard .foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.tabs { display: inline-flex; background: #e9ecf3; border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.section-title { font-size: 15px; font-weight: 700; color: var(--navy); margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.parked-list { display: flex; flex-direction: column; gap: 8px; }
.pitem { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); border-inline-start: 4px solid var(--warn); }
.pitem .grow { flex: 1; min-width: 0; }
.pitem b { display: block; }
.pitem small { color: var(--muted); display: block; }

/* ---------- To-Do: اللوحة ---------- */
body.board-body { overflow: hidden; }
.board-page { height: calc(100vh - 56px); display: flex; flex-direction: column; }
.board-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.board-head h1 { margin: 0; font-size: 18px; color: var(--navy); }
.board-head .sub { color: var(--muted); font-size: 13px; }
.board-head .spacer { flex: 1; }
.board-prog { display: flex; align-items: center; gap: 8px; min-width: 150px; font-size: 13px; color: var(--muted); }
.board-prog .bar { flex: 1; min-width: 80px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters input[type=text] { width: 170px; padding: 6px 10px; }
.filters select { width: auto; padding: 6px 10px; }
.board { flex: 1; display: flex; align-items: flex-start; gap: 14px; padding: 16px; overflow-x: auto; overflow-y: hidden; }
.col { flex: 0 0 310px; max-width: 310px; display: flex; flex-direction: column; max-height: 100%; background: #e9ecf3; border-radius: 14px; border-top: 4px solid var(--c, #5b6b8c); }
.col.drop-over { background: #dde3f0; outline: 2px dashed var(--navy-2); outline-offset: -4px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.col-head h3 { margin: 0; font-size: 15px; flex: 1; color: var(--navy); }
.col-count { background: #fff; border-radius: 20px; padding: 0 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.col-body { flex: 1; overflow-y: auto; padding: 6px 10px; min-height: 48px; display: flex; flex-direction: column; gap: 9px; }
.col-foot { padding: 8px 10px 10px; }
.add-card-btn { width: 100%; display: flex; align-items: center; gap: 6px; justify-content: center; background: transparent; border: 1px dashed #b5bdd0; border-radius: 10px; padding: 7px; color: var(--muted); }
.add-card-btn:hover { background: #fff; color: var(--navy); border-color: var(--navy-2); }
.quick { display: none; } .quick.open { display: block; }
.quick textarea { min-height: 62px; margin-bottom: 6px; }
.quick .qa { display: flex; gap: 6px; }
.card { background: var(--surface); border-radius: 11px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(20,30,60,.1); cursor: pointer; border-inline-start: 4px solid var(--p, #2b6cb0); transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: 0 4px 14px rgba(20,30,60,.16); }
.card[draggable=true] { cursor: grab; }
.card.dragging { opacity: .4; transform: rotate(1.5deg); }
.card.prio-low { --p: #8a94a6; } .card.prio-normal { --p: #2b6cb0; } .card.prio-high { --p: #d98e04; } .card.prio-urgent { --p: #c0392b; }
.card-title { font-weight: 600; word-break: break-word; }
.card.done .card-title { text-decoration: line-through; color: var(--muted); }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 1px 8px; border-radius: 20px; background: #eef0f6; color: var(--muted); font-weight: 600; }
.tag .ic { width: 12px; height: 12px; }
.tag.urgent { background: #fbe7e5; color: var(--danger); } .tag.high { background: #fdf1d6; color: #8a5a00; }
.card-note { margin-top: 6px; padding: 6px 9px; background: #fff8e6; border-radius: 8px; font-size: 13px; color: #5c4a14; display: flex; gap: 6px; align-items: flex-start; }
.card-note .ic { width: 14px; height: 14px; margin-top: 3px; }
.card-note span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.avatars { display: flex; }
.avatars .avatar { margin-inline-start: -6px; } .avatars .avatar:first-child { margin-inline-start: 0; }
.avatars .more { background: #aab2c5 !important; }
.card-meta { display: flex; gap: 10px; color: var(--muted); font-size: 12.5px; }
.card-meta span { display: inline-flex; align-items: center; gap: 3px; }
.card-meta .ic { width: 14px; height: 14px; }
.placeholder { height: 56px; border: 2px dashed var(--navy-2); border-radius: 11px; background: rgba(43,63,107,.08); flex: none; }
.add-col { flex: 0 0 240px; }

/* درج المهام المعلقة */
.drawer { position: fixed; top: 56px; bottom: 0; inset-inline-start: 0; width: 360px; max-width: 100vw; background: var(--surface); box-shadow: 6px 0 30px rgba(0,0,0,.18); z-index: 70; display: flex; flex-direction: column; transform: translateX(-102%); transition: transform .25s; }
html[dir=rtl] .drawer { transform: translateX(102%); inset-inline-start: auto; inset-inline-end: 0; left: auto; right: 0; box-shadow: -6px 0 30px rgba(0,0,0,.18); }
.drawer.open, html[dir=rtl] .drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 8px; }
.drawer-head h3 { margin: 0; flex: 1; font-size: 16px; color: var(--navy); }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pcard { border: 1px solid var(--line); border-inline-start: 4px solid var(--warn); border-radius: 11px; padding: 10px 12px; }
.pcard small { color: var(--muted); display: block; }

/* نافذة المهمة */
.card-modal { display: grid; grid-template-columns: 1fr 250px; gap: 20px; }
.cm-side .field { margin-bottom: 12px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 30px; cursor: pointer; background: #fff; font-size: 13px; user-select: none; }
html[dir=rtl] .mchip { padding: 3px 4px 3px 10px; }
.mchip.on { background: #e8edf8; border-color: var(--navy-2); font-weight: 600; }
.mchip .avatar { width: 22px; height: 22px; font-size: 9px; border: 0; }
.mchip.locked { opacity: .6; cursor: not-allowed; }
.timeline { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; max-height: 280px; overflow-y: auto; }
.tl-item { display: flex; gap: 10px; }
.tl-item .avatar { border: 0; margin-top: 2px; }
.tl-bubble { flex: 1; background: var(--bg); border-radius: 10px; padding: 7px 11px; font-size: 14px; word-break: break-word; white-space: pre-wrap; }
.tl-bubble small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 1px; }
.tl-item.sys .tl-bubble { background: transparent; padding: 0 11px; color: var(--muted); font-size: 13px; }
.tl-item.sys.park .tl-bubble, .tl-item.park .tl-bubble { background: #fff3d6; }
.tl-item.sys .avatar { display: none; }
.cm-side .btn { width: 100%; margin-bottom: 8px; }
.ro-note { font-size: 12.5px; color: var(--muted); }

@media (max-width: 820px) {
  .card-modal { grid-template-columns: 1fr; }
  .tb-user-name { display: none; }
  .col { flex-basis: 84vw; max-width: 84vw; }
  .filters input[type=text] { width: 120px; }
}
@media (max-width: 520px) {
  .row { flex-direction: column; gap: 0; }
  .perm-row { flex-wrap: wrap; } .perm-row select { width: 100%; }
}

/* ---------- الملف الشخصي ---------- */
.prof { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
.prof-card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 26px 20px; text-align: center; position: sticky; top: 76px; }
.prof-av { display: flex; justify-content: center; margin-bottom: 10px; }
.prof-card h2 { margin: 6px 0 2px; font-size: 19px; color: var(--navy); }
.prof-sub { color: var(--muted); font-size: 13.5px; }
.prof-actions { margin: 16px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.prof-meter { margin-top: 14px; text-align: start; } .prof-meter small { color: var(--muted); display: block; margin-top: 4px; }
.prof-main { display: flex; flex-direction: column; gap: 18px; }
.prof-sec { padding: 20px 22px; overflow: visible; }
.prof-sec h3 { font-size: 15px; color: var(--navy); margin: 18px 0 12px; display: flex; align-items: center; gap: 8px; }
.prof-sec h3:first-child { margin-top: 0; }
@media (max-width: 820px) { .prof { grid-template-columns: 1fr; } .prof-card { position: static; } }

/* ===== بث التنبيهات ===== */
.bc-modal { max-width: 520px; border-top: 6px solid #2b6cb0; overflow: hidden; }
.bc-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-size: 16px; color: #fff; background: linear-gradient(135deg, #2b6cb0, #4a90d9); }
.bc-head .ic { width: 24px; height: 24px; }
.bc-important { border-top-color: #d98e04; } .bc-important .bc-head { background: linear-gradient(135deg, #c27a00, #f2a516); }
.bc-urgent { border-top-color: #c0392b; animation: bcShake .5s 2; } .bc-urgent .bc-head { background: linear-gradient(135deg, #a3201f, #e0463c); }
.bc-body h3 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.bc-msg { white-space: pre-wrap; font-size: 16.5px; line-height: 1.8; margin-bottom: 12px; word-break: break-word; }
.bc-body small { color: var(--muted); }
.bc-hint { background: #eef3fb; color: #274066; border-radius: 10px; padding: 9px 12px; margin-bottom: 14px; font-size: 14px; }
.bc-t { width: 100%; border-collapse: collapse; font-size: 14px; } .bc-t th { text-align: start; background: #f2f4f9; padding: 8px 10px; color: var(--navy); font-size: 13px; } .bc-t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bc-gone { opacity: .55; }
@keyframes bcShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
/* ===== عيد ميلاد المستخدم: ثيم احتفالي + كونفيتي + بالونات ===== */
body.is-bday { --navy: #5b2a86; --navy-2: #7b3fa8; }
body.is-bday .topbar { position: sticky; background: linear-gradient(90deg, #5b2a86, #a8327a 55%, #d9612b); }
body.is-bday .topbar::after { content: ""; position: absolute; inset-inline: 0; bottom: -9px; height: 10px; pointer-events: none;
  background: conic-gradient(from 135deg at 50% 0, #ffb703 0 25%, transparent 0 75%, #ffb703 0) 0 0 / 22px 10px,
              conic-gradient(from 135deg at 50% 0, #f15bb5 0 25%, transparent 0 75%, #f15bb5 0) 11px 0 / 22px 10px;
  background-repeat: repeat-x; opacity: .95; }
body.is-bday.home-body { background: radial-gradient(900px 500px at 85% -10%, rgba(241,91,181,.16), transparent 60%), radial-gradient(800px 500px at 0% 0%, rgba(255,183,3,.16), transparent 60%), linear-gradient(180deg, #faf3fb, #f1e8f5); background-attachment: fixed; }
.tb-bday { display: flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: #fff; font: inherit; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.tb-bday:hover { background: rgba(255,255,255,.24); }
.tb-bday > span:first-child { font-size: 18px; line-height: 1; animation: bdayWiggle 1.6s ease-in-out infinite; }
@media (max-width: 640px) { .tb-bday-txt { display: none; } .tb-bday { padding: 4px 7px; } }
@keyframes bdayWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

.bday-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 310; }
.bday-balloons { position: fixed; inset: 0; pointer-events: none; z-index: 305; overflow: hidden; }
.bday-balloons i { position: absolute; bottom: -140px; inset-inline-start: var(--x); width: 54px; height: 66px; border-radius: 50% 50% 47% 47%; background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.65), transparent 22%), var(--c); transform: scale(var(--s)); animation: bdayRise var(--d) ease-in var(--w) forwards; box-shadow: inset -6px -8px 0 rgba(0,0,0,.08); }
.bday-balloons i::after { content: ""; position: absolute; top: 100%; left: 50%; width: 1px; height: 60px; background: rgba(0,0,0,.25); }
.bday-balloons i::before { content: ""; position: absolute; top: calc(100% - 2px); left: calc(50% - 4px); border: 4px solid transparent; border-bottom-color: var(--c); }
@keyframes bdayRise { 0% { transform: translateY(0) scale(var(--s)) rotate(-4deg); } 50% { transform: translateY(-60vh) scale(var(--s)) rotate(5deg); } 100% { transform: translateY(-125vh) scale(var(--s)) rotate(-3deg); } }

.bday-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(40,16,60,.45); animation: fade .2s; }
.bday-overlay.out { opacity: 0; transition: opacity .25s; }
.bday-card { position: relative; width: min(420px, 100%); text-align: center; background: linear-gradient(160deg, #fff, #fff5fb); border-radius: 20px; padding: 28px 22px 22px; box-shadow: 0 20px 60px rgba(60,20,90,.35); animation: bdayPop .45s cubic-bezier(.2,1.4,.4,1); }
.bday-card h2 { margin: 6px 0 8px; font-size: 24px; color: #7b2f8f; }
.bday-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.8; }
.bday-cake { font-size: 64px; line-height: 1; animation: bdayWiggle 1.8s ease-in-out infinite; }
.bday-x { position: absolute; top: 8px; inset-inline-end: 10px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.bday-x:hover { background: rgba(0,0,0,.06); }
.bday-card .btn-primary { background: linear-gradient(90deg, #a8327a, #d9612b); border-color: transparent; min-width: 140px; }
@keyframes bdayPop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bday-card, .bday-cake, .tb-bday > span:first-child { animation: none; } }

/* تنبيه أعياد ميلاد الزملاء في الصفحة الرئيسية */
.bday-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 640px; margin: 0 auto 22px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(90deg, #fff4fb, #fff8e8); border: 1px solid #f3d3e6; box-shadow: var(--shadow); }
.bday-note .bday-ic { font-size: 26px; line-height: 1; }
.bday-note .bday-txt { flex: 1; min-width: 180px; }
.bday-note .bday-txt b { color: #7b2f8f; }
.bday-note .bday-txt small { display: block; color: var(--muted); }
.bday-note .avatars { display: flex; gap: 4px; }
/* الأونلاين نسخة مزامنة من السيرفر (للاطلاع فقط) */
.tb-replica { font-size: 12px; font-weight: 700; color: #7a4b00; background: #fff4d6; border: 1px solid #f2c200; border-radius: 20px; padding: 3px 10px; margin-inline-end: 8px; white-space: nowrap; }
@media (max-width: 640px) { .tb-replica { display: none; } }

/* ===== قفل الخمول (10 دقائق) ===== */
body.is-locked { overflow: hidden; }
.lock-screen { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; background: rgba(20, 30, 52, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lock-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: #fff; width: min(360px, 90vw); }
.lock-box .lock-av { width: 120px; height: 120px; font-size: 42px; border: 4px solid rgba(255,255,255,.85); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.lock-name { font-size: 24px; margin-top: 6px; } .lock-box small { color: #c9d6ee; font-size: 13px; line-height: 1.6; }
.lock-form { display: flex; gap: 8px; width: 100%; margin-top: 10px; } .lock-form input { flex: 1; font-size: 17px; padding: 12px; border-radius: 10px; border: none; }
.lock-form .btn { padding: 0 22px; font-size: 16px; }
.lock-err { background: #c0392b; color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 14px; }
.lock-other { color: #ffd75e; margin-top: 14px; font-size: 14px; text-decoration: underline; }
/* أزرار الشريط العلوي: ملء الشاشة وقفل الشاشة */
.tb-ic { background: transparent; border: none; color: #c9d6ee; width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-inline-end: 4px; }
.tb-ic:hover, .tb-ic.on { background: rgba(255,255,255,.12); color: #fff; } .tb-ic .ic { width: 18px; height: 18px; }
@media (max-width: 480px) { #tbFull { display: none; } }

/* ===== طلبات عملاء تيليجرام (الجرس في الشريط العلوي) ===== */
.tb-tgo { position: relative; }
.tgo-badge { position: absolute; top: 1px; inset-inline-end: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #e5322d; color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #1c2b4a; }
.tb-tgo.has-new { color: #fff; }
.tb-tgo.has-new .ic { animation: tgo-ring 1.6s ease-in-out infinite; transform-origin: 50% 10%; }
.tb-tgo.has-new .tgo-badge { animation: tgo-pulse 1.6s ease-in-out infinite; }
@keyframes tgo-ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } }
@keyframes tgo-pulse { 0%, 100% { box-shadow: 0 0 0 2px #1c2b4a, 0 0 0 0 rgba(229,50,45,.7); } 50% { box-shadow: 0 0 0 2px #1c2b4a, 0 0 0 7px rgba(229,50,45,0); } }
@media (prefers-reduced-motion: reduce) { .tb-tgo.has-new .ic, .tb-tgo.has-new .tgo-badge { animation: none; } }
.tgo-modal { max-width: 860px; }
.tgo-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tgo-card { border: 1px solid #e3e6ee; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.tgo-card.open { border-inline-start: 5px solid #e5322d; }
.tgo-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 16px; }
.tgo-t { margin-inline-start: auto; color: #6b7487; font-size: 13px; }
.tgo-meta { color: #4a5368; font-size: 13px; margin: 4px 0 6px; }
.tgo-items { margin: 6px 0; padding-inline-start: 20px; font-size: 16px; line-height: 1.8; }
.tgo-unk { color: var(--warn); }
.tgo-notes { background: #fff8e6; border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.tgo-raw summary { cursor: pointer; color: #4a5368; font-size: 13px; }
.tgo-raw pre { white-space: pre-wrap; font-family: inherit; background: #f5f6fa; padding: 8px; border-radius: 8px; margin: 6px 0 0; }
.tgo-hist { font-size: 12.5px; color: #6b7487; margin-top: 6px; }
.tgo-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ===== Elrehab Gold (26/11/2026): الضغط على اللمبة الخضراء يبدّل للبرنامج/Gold. ثيم Gold الكامل في assets/css/gold.css (يُحمَّل في Gold فقط) ===== */
.rt-dot[data-gold] { cursor: pointer; width: 8px; height: 8px; margin-inline-end: 6px; }
.rt-dot[data-gold]:hover, .rt-dot[data-gold]:focus-visible { box-shadow: 0 0 0 4px rgba(61,220,151,.35); outline: none; }
.tb-gold-note { font-weight: 700; font-size: 12px; border-radius: 12px; padding: 3px 10px; margin-inline-end: 8px; white-space: nowrap; }
@media (max-width: 760px) { .tb-gold-note { display: none; } body.gold-mode .gold-stamp > span:nth-child(2) { display: none; } body.gold-mode .tb-brand span { line-height: 1.15; } body.gold-mode .tb-brand span::after { content: "البيانات المسجّلة حكومياً فقط"; display: block; font-size: 10.5px; font-weight: 700; } }
@media print { .gold-stamp { display: flex !important; } }
/* أي إشعار/تنبيه على النظام لا يُطبع أبداً (التوست، جرس البريد، الإعلانات، الدردشة، تأثيرات عيد الميلاد) — مهما كانت الصفحة المطبوعة */
@media print { .toasts, .toast, .mlb-pop, .bc-overlay, .bday-confetti, .bday-balloons, .bday-overlay, #chatRoot, .lock-screen { display: none !important; } }
/* جرس طلب الفاتورة الإلكترونية: الصوت ممنوع حتى أول لمسة للصفحة — شريط ثابت يطلب الضغط */
.bell-locked{position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:9999;background:#b3261e;color:#fff;padding:12px 18px;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.35);display:flex;flex-direction:column;gap:2px;max-width:min(92vw,560px);cursor:pointer;animation:bellPulse 1s ease-in-out infinite}
.bell-locked small{opacity:.9;font-size:12.5px}
@keyframes bellPulse{0%,100%{box-shadow:0 8px 28px rgba(179,38,30,.45)}50%{box-shadow:0 8px 34px rgba(179,38,30,.95)}}
.bell-perm{position:fixed;bottom:14px;inset-inline-start:14px;z-index:9998;background:var(--card,#fff);color:var(--ink,#1d2433);border:1px solid var(--line,#dfe3ea);border-radius:12px;padding:10px 12px;box-shadow:0 6px 22px rgba(0,0,0,.18);display:flex;gap:8px;align-items:center;flex-wrap:wrap;max-width:min(94vw,520px);font-size:13.5px}
@media print{.bell-locked,.bell-perm{display:none!important}}
