/* منصة سكن الطلبة — نظام التصميم المشترك */
:root {
  --ink: #11273b;
  --ink-2: #44596b;
  --ink-3: #7a8b99;
  --paper: #f4f7f9;
  --card: #ffffff;
  --line: #dbe3e9;
  --key: #f4b400;
  --key-ink: #3b2c00;
  --teal: #0b7a75;
  --ok: #17803d; --ok-bg: #e5f5ea;
  --warn: #8a5a00; --warn-bg: #fff3d6;
  --bad: #b42318; --bad-bg: #fde8e6;
  --info: #1d5fa8; --info-bg: #e4effb;
  --text: #11273b;
  --soft: #e6edf2; --skel: #e9eff3; --warm: #fffaf0; --warm-line: #f0dca0; --info-line: #b9d4f2; --ok-line: #b6e2c3; --hover-line: #c2cfd9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 39, 59, .06), 0 6px 20px rgba(17, 39, 59, .06);
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: radial-gradient(ellipse at 8% 5%, rgba(17, 91, 119, .055), transparent 34%), radial-gradient(ellipse at 92% 28%, rgba(11, 122, 117, .045), transparent 30%), var(--paper); color: var(--text); line-height: 1.75; font-size: 16px; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--teal); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.hidden, [hidden] { display: none !important; }
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
:focus-visible { outline: 3px solid var(--key); outline-offset: 2px; border-radius: 6px; }

/* ---------- الشريط العلوي ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .container { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a, .nav button { background: none; border: 0; font: inherit; color: var(--ink-2); padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.nav a:hover, .nav button:hover { background: var(--paper); color: var(--text); }
.nav a[aria-current="page"], .nav .active { background: var(--ink); color: #fff; }
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox .name { font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- الأزرار ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 600; padding: 10px 20px; border-radius: 10px; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: #1b3a55; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-key { background: var(--key); border-color: var(--key); color: var(--key-ink); }
.btn-key:hover { background: #e0a400; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); border-color: var(--ink-3); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #8f1c12; }
.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-ok:hover { background: #10652f; }
.btn-sm { padding: 5px 12px; font-size: .875rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- النماذج ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .field > .lbl { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .8rem; color: var(--ink-3); }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11, 122, 117, .18); }
select:disabled { background: var(--paper); color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; }

/* قائمة الخدمات المنسدلة (اختيار متعدد) */
.ms { position: relative; }
.ms-btn { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--text); cursor: pointer; text-align: start; }
.ms-btn:hover { border-color: var(--ink-3); }
.ms-label.placeholder { color: var(--ink-3); }
.ms-panel { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; z-index: 30; padding: 6px; }
.ms-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 400; }
.ms-item:hover { background: var(--paper); }
.ms-item input { width: 18px; height: 18px; min-height: 0; accent-color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: .85rem; color: var(--ink-2); }

/* ---------- الشارات ---------- */
.badge { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.b-pending { background: var(--warn-bg); color: var(--warn); }
.b-approved, .b-accepted, .b-active { background: var(--ok-bg); color: var(--ok); }
.b-rejected, .b-blocked { background: var(--bad-bg); color: var(--bad); }
.b-cancelled { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- البطاقات والقوائم ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.listing { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; }
.listing:hover { box-shadow: var(--shadow); border-color: var(--hover-line); }
.listing .thumb { position: relative; aspect-ratio: 4 / 3; background: var(--soft); }
.listing .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--ink-3); font-size: .9rem; background: repeating-linear-gradient(135deg, var(--skel), var(--skel) 10px, var(--soft) 10px, var(--soft) 20px); }
.listing .tag { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; background: var(--key); color: var(--key-ink); font-weight: 700; font-size: .78rem; padding: 2px 10px; border-radius: 6px; }
.fav { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); cursor: pointer; font-size: 1.2rem; color: #9aa9b5; display: grid; place-items: center; }
.fav.on { color: #d6336c; }
.listing .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.listing h3 { font-size: 1.05rem; margin: 0; }
.listing .price { font-size: 1.15rem; font-weight: 700; }
.listing .price small { font-weight: 400; color: var(--ink-2); font-size: .8rem; }
.rating { color: #9a6b00; font-weight: 600; font-size: .9rem; }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { color: var(--text); }
.skeleton { height: 280px; border-radius: var(--radius); background: linear-gradient(90deg, var(--skel) 25%, #f4f7f9 50%, var(--skel) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 28px 0 8px; }

/* ---------- الواجهة الرئيسية للطالب ---------- */
.hero { background: radial-gradient(ellipse at 82% 18%, rgba(44, 196, 181, .28), transparent 34%), radial-gradient(ellipse at 12% 110%, rgba(244, 180, 0, .16), transparent 42%), linear-gradient(125deg, #0b1f31 0%, #123c56 54%, #0b5960 100%); color: #fff; padding: clamp(34px, 6vw, 62px) 0 clamp(58px, 8vw, 94px); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset-inline-end: -90px; inset-block-start: -90px; width: 320px; height: 320px; border-radius: 50%; border: 36px solid rgba(244, 180, 0, .72); opacity: .9; box-shadow: 0 0 0 28px rgba(255,255,255,.035), 0 0 0 70px rgba(255,255,255,.025); }
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 700; max-width: 14ch; margin-bottom: 14px; }
.hero p { color: #c3d1dc; max-width: 46ch; font-size: 1.05rem; }
.finder { margin-top: -62px; position: relative; z-index: 5; padding: 22px; box-shadow: var(--shadow); }
.finder-place { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; margin-bottom: 14px; }
.finder-place .arrow { padding-bottom: 20px; color: var(--ink-3); font-size: 1.3rem; }
.finder-place select { font-size: 1.05rem; font-weight: 600; min-height: 52px; border-color: var(--ink); }
.finder-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.results-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 28px 0 16px; }
.results-head h2 { margin: 0; font-size: 1.25rem; }

/* ---------- النوافذ ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(940px, 94vw); max-height: 92vh; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog.narrow { width: min(460px, 94vw); }
dialog::backdrop { background: rgba(17, 39, 59, .6); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.dlg-head h2 { margin: 0; font-size: 1.15rem; }
.dlg-body { padding: 22px; overflow: auto; max-height: calc(92vh - 70px); }
.x { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-2); width: 40px; height: 40px; border-radius: 8px; }
.x:hover { background: var(--paper); }
.detail { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; }
.gallery .main { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--soft); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; width: 72px; height: 54px; flex: none; cursor: pointer; background: none; }
.thumbs button.on { border-color: var(--key); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; gap: 8px; margin: 14px 0; }
.facts div { display: flex; gap: 8px; }
.facts b { min-width: 92px; color: var(--ink-2); font-weight: 600; }
.landmark { background: var(--warn-bg); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.review { border-top: 1px solid var(--line); padding: 10px 0; }

/* ---------- التبويبات والجداول ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 22px 0; overflow-x: auto; }
.tabs button { background: none; border: 0; font: inherit; font-weight: 600; color: var(--ink-2); padding: 10px 18px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--key); }
.count { background: var(--key); color: var(--key-ink); border-radius: 999px; padding: 0 8px; font-size: .78rem; margin-inline-start: 6px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .93rem; }
th { background: var(--paper); font-weight: 600; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
.mini { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--soft); }

.item { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.item .pic { width: 150px; height: 112px; border-radius: 10px; overflow: hidden; flex: none; background: var(--soft); }
.item .pic img { width: 100%; height: 100%; object-fit: cover; }
.item .info { flex: 1; min-width: 220px; }
.item .actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.note-bad { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 6px 12px; font-size: .88rem; margin-top: 6px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.photo .meta { padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: .82rem; }
.photo .meta .row { gap: 6px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .n { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.stat.alert { border-color: var(--key); background: var(--warm); }

/* ---------- بوابة الدخول ---------- */
.gate { max-width: 440px; margin: 56px auto; }
.gate h1 { font-size: 1.6rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.seg button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- إدارة ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding-block: 28px; align-items: start; }
.side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 84px; }
.side button { display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0; font: inherit; font-weight: 600; color: var(--ink-2); padding: 10px 14px; border-radius: 8px; cursor: pointer; text-align: start; }
.side button:hover { background: var(--paper); }
.side button.active { background: var(--ink); color: #fff; }

#toasts { position: fixed; inset-block-end: 20px; inset-inline-start: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; animation: tin .2s ease-out; }
.toast.err { background: var(--bad); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

.foot { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: .88rem; }

@media (max-width: 820px) {
  .topbar .container { gap: 8px 12px; padding-block: 8px; }
  .nav { order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .nav a, .nav button { white-space: nowrap; padding: 6px 12px; }
  .userbox { margin-inline-start: auto; }
  .detail { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .side { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .side button { white-space: nowrap; width: auto; gap: 8px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .finder-place { grid-template-columns: 1fr; }
  .finder-place .arrow { display: none; }
  .hero::after { width: 200px; height: 200px; border-width: 24px; inset-inline-end: -70px; }
  .item .pic { width: 100%; height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- الإشعارات والمحادثات ---------- */
.inbox-btns { display: inline-flex; gap: 4px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.1rem; display: grid; place-items: center; }
.icon-btn:hover { background: var(--paper); }
.dot { position: absolute; inset-block-start: -6px; inset-inline-end: -6px; background: var(--bad); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; font-size: .72rem; display: grid; place-items: center; padding: 0 5px; }
.list-body { padding: 8px 12px !important; }
.notif { padding: 12px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.notif:hover { background: var(--paper); }
.notif.unread { background: var(--warm); border-inline-start: 4px solid var(--key); }
dialog.chat { width: min(520px, 96vw); display: flex; flex-direction: column; }
dialog.chat[open] { display: flex; }
.chat-log { height: min(56vh, 460px); overflow: auto; padding: 14px; background: var(--paper); display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; align-self: flex-start; word-break: break-word; }
.msg.mine { align-self: flex-end; background: var(--ink); color: #fff; border-color: var(--ink); border-radius: 14px 14px 4px 14px; }
.msg small { display: block; opacity: .65; font-size: .7rem; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px 6px; }

/* ---------- الدفع والتسعير ---------- */
.price-box { background: var(--warm); border: 1px solid var(--warm-line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.price-box .ln { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.price-box .ln.total { border-top: 1.5px solid var(--ink); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 1.1rem; }
.pay-box { background: var(--info-bg); border: 1px solid var(--info-line); border-radius: 12px; padding: 14px 16px; margin-top: 10px; }
.pay-num { font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; direction: ltr; display: inline-block; background: var(--card); border-radius: 8px; padding: 2px 12px; border: 1px dashed var(--info); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.step { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-3); }
.step.on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); font-weight: 600; }
.step.cur { background: var(--warn-bg); color: var(--warn); border-color: var(--warm-line); font-weight: 600; }

/* ---------- العرض العام للحجوزات + الإعلانات الممولة ---------- */
.live { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 16px 20px; margin: 24px 0; }
.live-head { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.live-head .big { font-size: 1.8rem; font-weight: 700; color: var(--key); line-height: 1.2; }
.live-head small { color: #c3d1dc; display: block; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; display: inline-block; margin-inline-end: 6px; animation: pl 1.6s infinite; }
@keyframes pl { 50% { opacity: .3; } }
.live-feed { display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.live-feed div { background: rgba(255, 255, 255, .08); border-radius: 8px; padding: 6px 12px; font-size: .9rem; }
.live-feed small { color: #9fb3c4; margin-inline-start: 6px; }
.sponsored-sec { margin: 28px 0 8px; }
.sponsored-sec h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.sponsored-sec .cards { }
.listing.is-ad { border-color: var(--key); box-shadow: 0 0 0 2px rgba(244, 180, 0, .25); }
.ad-tag { position: absolute; inset-block-end: 10px; inset-inline-start: 10px; background: var(--card); color: var(--text); font-weight: 700; font-size: .75rem; padding: 2px 10px; border-radius: 6px; border: 1px solid var(--key); }
.price .fee-note { display: block; font-weight: 400; font-size: .72rem; color: var(--ink-3); }
.kv { display: grid; gap: 6px; }
.photo-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cat-box { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; background: var(--card); }
.cat-box.req { border-color: var(--key); }
.cat-box h4 { margin: 0 0 6px; font-size: .95rem; }
.cat-box .photo-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); margin-top: 8px; }
.cat-box .photo .meta { display: none; }
.cat-box .photo img { cursor: default; }
.cat-box .rm { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; background: rgba(0,0,0,.65); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.cat-box .photo { position: relative; }
.gallery-cat { font-size: .8rem; color: var(--ink-2); margin: 4px 0 0; }
.method-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--card); margin-bottom: 10px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.tag-def { background: var(--ok-bg); color: var(--ok); font-size: .75rem; padding: 1px 10px; border-radius: 999px; font-weight: 600; }
.warn-box { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: .92rem; }
.sm-actions { display: flex; gap: 6px; flex-wrap: wrap; }
textarea.tall { min-height: 160px; }

/* ---------- عدّاد الحجوزات ---------- */
.counter { background: radial-gradient(1200px 400px at 90% -10%, #1d4466 0%, transparent 60%), linear-gradient(160deg, #0d2033, #11273b 60%, #16324b); color: #fff; border-radius: 20px; padding: clamp(16px, 3vw, 30px); margin: 24px 0; box-shadow: 0 18px 44px rgba(10, 30, 50, .28); }
.counter h2 { font-size: 1.1rem; margin: 0; color: #dbe7f1; font-weight: 600; }
.counter-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(61, 220, 132, .16); color: #6ff0a8; border: 1px solid rgba(61, 220, 132, .4); border-radius: 999px; padding: 2px 12px; font-size: .8rem; font-weight: 700; }
.live-badge .pulse { margin: 0; }
.counter .muted { color: #9fb3c4; margin-inline-start: auto; }
.counter-main { display: grid; grid-template-columns: minmax(220px, 1.1fr) 2fr; gap: 20px; align-items: center; }
.big { font-size: clamp(3rem, 9vw, 5.6rem); line-height: 1; font-weight: 800; color: var(--key); letter-spacing: -1px; font-variant-numeric: tabular-nums; text-shadow: 0 4px 30px rgba(244, 180, 0, .35); }
.big.bump { animation: bump .7s ease; }
@keyframes bump { 30% { transform: scale(1.08); text-shadow: 0 0 40px rgba(244, 180, 0, .9); } }
.big-l { color: #c3d1dc; margin-top: 6px; font-size: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 12px 14px; }
.kpi-n { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.ok .kpi-n { color: #6ff0a8; }
.kpi-l { color: #b4c6d4; font-size: .85rem; }
.counter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.cbox { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09); border-radius: 14px; padding: 12px 14px; }
.cbox h3 { margin: 0 0 8px; font-size: .9rem; color: #c3d1dc; font-weight: 600; }
.cbox p { margin: 6px 0 0; }
.spark { width: 100%; height: 64px; display: block; }
.spark-line { fill: none; stroke: var(--key); stroke-width: 2.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: rgba(244, 180, 0, .14); }
.spark-dot { fill: var(--key); }
.bar { height: 12px; background: rgba(255, 255, 255, .12); border-radius: 99px; overflow: hidden; }
.bar.sm { height: 8px; flex: 1; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f4b400, #ffd75e); border-radius: 99px; transition: width 1s ease; }
.toprow { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin: 5px 0; }
.toprow span { min-width: 78px; }
.cbox.cstats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cbox.cstats div { display: flex; flex-direction: column; }
.cbox.cstats b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.cbox.cstats span { font-size: .75rem; color: #9fb3c4; }
.feed { display: grid; gap: 6px; max-height: 210px; overflow: auto; margin-top: 14px; }
.feed-i { background: rgba(255, 255, 255, .07); border-radius: 10px; padding: 7px 12px; font-size: .9rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-i small { color: #9fb3c4; }
.feed-i.fresh { animation: fresh 2.2s ease; }
@keyframes fresh { 0% { background: rgba(244, 180, 0, .55); transform: translateY(-6px); } 100% { background: rgba(255, 255, 255, .07); transform: none; } }
.fk { width: 9px; height: 9px; border-radius: 50%; background: #7fb0ff; flex: none; }
.fk.k-accepted { background: var(--key); }
.fk.k-confirmed { background: #3ddc84; }
.counter-widget { margin: 0; border-radius: 16px; padding: 16px; }
.counter-widget .counter-main { grid-template-columns: 1fr; gap: 12px; }
.counter-widget .big { font-size: 3.4rem; }
.counter-page { margin: 0 auto; max-width: 1100px; }
.counter-page .big { font-size: clamp(3.6rem, 14vw, 8rem); }
.counter-page .kpi-n { font-size: 2.3rem; }
@media (max-width: 720px) { .counter-main { grid-template-columns: 1fr; } .big-wrap { text-align: center; } }
@media (prefers-reduced-motion: reduce) { .big.bump, .feed-i.fresh, .pulse { animation: none; } .bar i { transition: none; } }

/* صفحة العدّاد */
.cpage { min-height: 100vh; background: #0a1a29; color: #fff; }
.cpage .container { padding-block: 22px; }
.cpage-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cpage-top a.brand { color: #fff; }
.cpage .counter { background: transparent; box-shadow: none; padding: 0; margin-top: 18px; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 22px 0; }
.cpage .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.cpage pre { background: rgba(255, 255, 255, .07); padding: 12px; border-radius: 10px; overflow: auto; direction: ltr; text-align: left; font-size: .82rem; }
.lang-btn { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; cursor: pointer; font: inherit; min-height: 40px; }
.cpage .lang-btn { color: #fff; border-color: rgba(255, 255, 255, .35); }
html[dir=ltr] body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
.cpage .brand svg { background: #ffffff; border-radius: 9px; padding: 3px; }

/* شريط العدّاد داخل الـ hero */
.counter-strip { display: flex; align-items: center; gap: 10px 26px; flex-wrap: wrap; margin-top: 20px; max-width: 820px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 12px 20px; color: #fff; backdrop-filter: blur(4px); }
.counter-strip .st { display: flex; flex-direction: column; line-height: 1.15; }
.counter-strip .st b { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.counter-strip .st b.big { color: var(--key); font-size: 2.3rem; text-shadow: none; }
.counter-strip .st.ok b { color: #6ff0a8; }
.counter-strip .st span { font-size: .8rem; color: #c3d1dc; }
.counter-strip .st-link { margin-inline-start: auto; color: var(--key); font-weight: 600; text-decoration: none; font-size: .9rem; }
.counter-strip .st-link:hover { text-decoration: underline; }
@media (max-width: 560px) { .counter-strip { gap: 8px 16px; padding: 10px 14px; } .counter-strip .st b { font-size: 1.5rem; } .counter-strip .st b.big { font-size: 1.9rem; } }

/* English / LTR refinements */
html[dir=ltr] .finder .arrow { transform: scaleX(-1); display: inline-block; }
html[dir=ltr] .nav a { padding-inline: 10px; font-size: .92rem; white-space: nowrap; }
html[dir=ltr] .topbar .container { flex-wrap: wrap; }
html[dir=ltr] .hero h1 { max-width: 16ch; }
@media (max-width: 560px) {
  .counter-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
  .counter-strip .live-badge { grid-column: 1 / -1; justify-self: start; }
  .counter-strip .st-link { grid-column: 1 / -1; margin: 2px 0 0; }
  .counter-strip .st span { font-size: .72rem; }
}


/* ---------- الوضع الليلي ---------- */
html[data-theme=dark] {
  color-scheme: dark;
  --text: #e7eef5; --ink: #2c5f8f; --ink-2: #aebdca; --ink-3: #8394a3;
  --paper: #0b1620; --card: #132130; --line: #24384b; --teal: #45c4bc;
  --ok: #5fd68a; --ok-bg: #12321f; --warn: #f0c05a; --warn-bg: #3a2d0c; --bad: #ff8f84; --bad-bg: #3b1815; --info: #7ab8f5; --info-bg: #102a42;
  --soft: #1c2e3f; --skel: #1b2c3c; --warm: #2d2610; --warm-line: #5a4a1c; --info-line: #1f4b73; --ok-line: #1f5a37; --hover-line: #3a5268;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
}
html[data-theme=dark] input, html[data-theme=dark] select, html[data-theme=dark] textarea, html[data-theme=dark] .ms-btn { background: #0e1b27; }
html[data-theme=dark] .hero { background: #0a1622; }
html[data-theme=dark] .brand svg { background: #fff; border-radius: 8px; padding: 2px; }
html[data-theme=dark] dialog::backdrop { background: rgba(0, 0, 0, .7); }
html[data-theme=dark] .btn-ghost { background: transparent; }
html[data-theme=dark] .step.on, html[data-theme=dark] .step.cur { border-color: transparent; }
html[data-theme=dark] .msg.mine { background: var(--ink); border-color: var(--ink); }
html[data-theme=dark] .toast { background: #e7eef5; color: #0b1620; }
html[data-theme=dark] .pay-num { background: #0e1b27; }

/* زر الوضع الليلي + زر الرجوع */
.back-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--card); color: var(--text); border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 14px; min-height: 40px; font: inherit; font-weight: 600; cursor: pointer; }
.back-btn:hover { background: var(--paper); }
.back-btn .arr { display: inline-block; }
html[dir=ltr] .back-btn .arr { transform: scaleX(-1); }
[data-theme-toggle] { font-size: 1.1rem; line-height: 1; }


/* تحسينات توافق الشاشات الصغيرة والهواتف */
html { scroll-padding-top: 76px; }
button, input, select, textarea { max-width: 100%; }
.container, .panel, .admin-layout, #content { min-width: 0; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { min-width: 680px; }
dialog { max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); overflow: hidden; }
dialog .dlg-body { overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 560px) {
  body { font-size: 15px; }
  .container { padding-inline: 14px; }
  .topbar .container { gap: 7px; }
  .brand { font-size: 1rem; }
  .userbox { max-width: 100%; flex-wrap: wrap; gap: 6px; }
  .userbox .name { max-width: 42vw; }
  .nav { gap: 2px; }
  .nav a, .nav button { padding: 7px 10px; font-size: .84rem; }
  .hero { padding-block: 30px 56px; }
  .hero h1 { font-size: clamp(1.65rem, 8vw, 2.2rem); }
  .hero p { font-size: .95rem; }
  .finder, .panel { padding: 14px; }
  .cards { grid-template-columns: minmax(0, 1fr) !important; }
  .results-head { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-width: 0; padding: 12px; }
  .stat .n { font-size: 1.35rem; overflow-wrap: anywhere; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .row > .btn { max-width: 100%; }
  .guest-support-btn { inset-inline-start: 12px; inset-block-end: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .foot { padding: 28px 14px calc(90px + env(safe-area-inset-bottom, 0px)); }
}
html[data-theme=dark] body { background: radial-gradient(ellipse at 8% 5%, rgba(32, 105, 130, .12), transparent 34%), radial-gradient(ellipse at 92% 28%, rgba(11, 122, 117, .08), transparent 30%), var(--paper); }

/* ===== إصلاح توافق الموبايل — ضعه في آخر ملف style.css (آخر قواعد الملف تتغلّب على ما قبلها) ===== */

/* 1) السبب الرئيسي لتشوّه صفحة السكن: عمود 1fr يتمدّد مع شريط الصور المصغّرة */
.detail { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.detail > * { min-width: 0; }
.admin-layout { grid-template-columns: 220px minmax(0, 1fr); }
.admin-layout > * { min-width: 0; }
@media (max-width: 820px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
}

/* 2) أزرار الإجراءات في الجداول: لا تتكدّس فوق بعض */
.sm-actions { gap: 5px; min-width: 240px; }
.sm-actions .btn { white-space: nowrap; padding: 5px 9px; font-size: .8rem; min-height: 32px; }
td:has(> .sm-actions) { min-width: 240px; }

/* =====================================================================
   توافق كامل مع الموبايل (من 320px فصاعداً)
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, video, svg, canvas, iframe { max-width: 100%; }
pre, code { white-space: pre-wrap; word-break: break-word; max-width: 100%; }
p, h1, h2, h3, h4, li, .facts span, .item .info, .notif, .dlg-body { overflow-wrap: anywhere; }
th { white-space: nowrap; }
td { overflow-wrap: break-word; word-break: normal; }
dialog { max-width: calc(100vw - 16px); }
.table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 680px; }
.leaflet-container { max-width: 100%; }

@media (max-width: 820px) {
  .topbar .container { padding-inline: 12px; }
  .userbox { flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 100%; min-width: 0; }
  .userbox .name { max-width: 44vw; }
  .userbox .btn-sm, .userbox .btn { padding: 6px 10px; min-height: 38px; }
  .brand { white-space: nowrap; }
  .back-btn { padding: 6px 10px; }
  .finder { padding: 18px; }
  .finder-more { grid-template-columns: minmax(0, 1fr); }
  .tabs { margin: 16px 0; }
  .row.between { gap: 8px; }
}

@media (max-width: 560px) {
  .container { padding-inline: 12px; }
  .topbar .container { min-height: 0; }
  .hero { padding-block: 34px 84px; }
  .hero h1 { font-size: 1.9rem; line-height: 1.35; }
  .finder { margin-top: -44px; padding: 14px; }
  /* النوافذ تظهر كورقة سفلية بعرض الشاشة */
  dialog, dialog.narrow, dialog.chat { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  dialog .dlg-head, dialog .dlg-body { padding-inline: 14px; }
  dialog .dlg-body { overflow-x: hidden; }
  .detail { gap: 14px; }
  .facts div { flex-wrap: wrap; gap: 2px 8px; }
  .facts b { min-width: 76px; }
  .thumbs button { width: 64px; height: 48px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .item { padding: 12px; gap: 12px; }
  .item .info { min-width: 0; flex: 1 1 100%; }
  .item .actions { width: 100%; }
  .item .actions .btn, .sm-actions .btn { flex: 1 1 auto; }
  .sm-actions { width: 100%; }
  .tabs button { padding: 10px 12px; }
  .chat-log { height: min(52dvh, 420px); }
  .chat-form { padding: 10px 12px; }
  .msg { max-width: 90%; }
  .price-box { padding: 12px; }
  .price-box .ln { gap: 8px; }
  .price-box .ln span { min-width: 0; }
  /* تفادي تكبير iOS التلقائي عند التركيز على الحقول + أهداف لمس مريحة */
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .icon-btn { width: 36px; height: 36px; }
  .topbar .container button, .topbar .btn { font-size: .85rem; }
  .topbar .btn, .topbar .btn-sm { padding: 5px 10px; min-height: 36px; }
  .userbox { gap: 5px; }
  .toast, .toasts { max-width: calc(100vw - 24px); }
  .side { padding: 6px; }
  .admin-layout { padding-block: 16px; gap: 16px; }
  .foot { padding: 28px 14px; }
}

@media (max-width: 360px) {
  .hero h1 { font-size: 1.6rem; }
  .userbox .name { max-width: 36vw; }
  .btn { padding-inline: 12px; }
}


/* هوية سكن المحدّثة: واجهة فاتحة، هيدر طبيعي، وقائمة موحدة */
:root { --ink:#18364b; --ink-2:#587083; --paper:#f7fafc; --card:#fff; --line:#e3ebf0; --key:#e9b84b; --teal:#16877f; --radius:16px; --shadow:0 8px 28px rgba(28,65,86,.075); }
body { background:linear-gradient(145deg,#f8fbfd 0%,#f2f8f7 55%,#fbfaf6 100%); }
.topbar { position:relative; top:auto; background:rgba(255,255,255,.94); border-bottom:1px solid #e5edf1; box-shadow:0 3px 16px rgba(25,58,78,.035); }
.topbar .container { min-height:72px; }
.brand { letter-spacing:-.2px; }
.brand svg { filter:drop-shadow(0 3px 5px rgba(18,120,112,.12)); }
.btn { border-radius:12px; }
.panel,.listing { border-radius:18px; box-shadow:0 4px 20px rgba(30,65,84,.035); }
.listing:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(30,65,84,.10); }
.account-menu { position:relative; margin-inline-start:8px; }
.account-menu summary { list-style:none; cursor:pointer; border:1px solid var(--line); border-radius:13px; padding:8px 14px; font-weight:700; color:var(--ink); background:#f8fbfc; }
.account-menu summary::-webkit-details-marker { display:none; }
.account-menu[open] summary { background:#eaf5f3; border-color:#b9ddd7; }
.account-menu-panel { position:absolute; z-index:80; inset-inline-end:0; top:calc(100% + 9px); width:230px; padding:8px; display:grid; gap:4px; background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:0 14px 38px rgba(20,48,66,.16); }
.account-menu-panel a { padding:9px 11px; color:var(--ink); text-decoration:none; border-radius:10px; }
.account-menu-panel a:hover { background:#eff7f6; }
@media(max-width:700px) { .topbar .container { gap:9px; padding-block:9px; } .topbar .nav { display:none; } .account-menu { order:4; } .userbox { margin-inline-start:auto; } .account-menu-panel { position:fixed; inset-inline:12px; top:72px; width:auto; } }

/* هوية بوابة الطالب — سكن */
.topbar { position:relative; top:auto; background:rgba(255,255,255,.96); backdrop-filter:blur(12px); }
.student-topbar { border-bottom:1px solid #e5eeeb; }
.student-topbar .container { min-height:76px; }
.student-topbar .brand { color:#174c48; font-size:1.45rem; letter-spacing:-.04em; }
.student-topbar .brand svg { width:36px;height:36px; }
.student-content { padding-top:26px; padding-bottom:64px; }
.student-hero { background:linear-gradient(115deg,#edf8f5 0%,#f7fbfa 54%,#fff8e8 100%); color:#173c39; padding:clamp(36px,6vw,74px) 0 92px; overflow:hidden; }
.student-hero::after { display:none; }
.student-hero .hero-grid { display:grid; grid-template-columns:1.05fr .95fr; align-items:center; gap:36px; position:relative; }
.student-hero h1 { color:#174c48; max-width:unset; font-size:clamp(2.3rem,5vw,4.2rem); letter-spacing:-.045em; line-height:1.18; }
.student-hero h1 em { color:#149487; font-style:normal; }
.student-hero p { color:#607a76; max-width:520px; font-size:1.08rem; line-height:2; }
.hero-kicker,.section-eyebrow { color:#159487; font-size:.83rem; font-weight:700; letter-spacing:.02em; }
.hero-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:25px; }
.btn-hero-ghost { background:#fff; border-color:#d8e8e3; color:#24544e; }
.hero-points { display:flex; flex-wrap:wrap; gap:18px; margin-top:22px; color:#6b8580; font-size:.86rem; }
.hero-art { min-height:310px; position:relative; display:grid; place-items:center; }
.hero-art-card { width:min(350px,80%); height:285px; border-radius:34px; background:linear-gradient(145deg,#d6eee6,#b9dfd5); position:relative; overflow:hidden; box-shadow:0 28px 65px rgba(39,111,99,.17); transform:rotate(-4deg); }
.art-house { position:absolute; z-index:2; top:38px; right:50%; transform:translateX(50%); width:150px; height:150px; border-radius:28px 28px 12px 12px; background:#fffdf7; color:#1a8b7f; display:grid; place-items:center; font-size:6rem; box-shadow:0 10px 30px rgba(39,111,99,.13); }
.art-window { position:absolute; width:75px;height:75px; bottom:25px;left:50%; transform:translateX(-50%); border-radius:15px 15px 0 0; background:#f6c96e; border:8px solid #fffdf7; }
.art-base { position:absolute; bottom:0; right:0; left:0; height:26px; background:#82bcae; }
.art-pill { position:absolute; z-index:3; top:16px; right:18px; padding:7px 14px; background:#fff; border-radius:30px; color:#28756c; font-size:.8rem; font-weight:700; }
.art-float { position:absolute; z-index:4; display:flex; align-items:center; gap:9px; background:#fff; color:#28645d; padding:12px 16px; border-radius:15px; box-shadow:0 12px 30px rgba(31,80,72,.12); font-weight:700; }
.art-float-one { top:35px; right:0; }.art-float-two { bottom:25px; left:0; }
.student-finder { margin-top:-48px; position:relative; z-index:5; border:1px solid #e4efeb; border-radius:24px; box-shadow:0 18px 50px rgba(33,79,70,.09); padding:clamp(18px,3vw,30px); }
.finder-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }.finder-heading h2 { margin:2px 0 0; color:#214b46; }.finder-icon { width:46px;height:46px;border-radius:15px;background:#e9f6f2;color:#168c7e;display:grid;place-items:center;font-size:2rem; }
.student-finder .finder-place { margin-bottom:6px; }.student-finder .finder-place select { border-color:#dceae5; background:#fbfdfc; }.finder-actions { display:flex; gap:9px; margin-top:10px; }
.student-content .results-head { margin-top:35px; }.student-content .results-head h2 { color:#244b46; font-size:1.5rem; }
.student-content .listing { border-color:#e6efeb; border-radius:18px; box-shadow:0 5px 18px rgba(28,72,64,.035); }.student-content .listing:hover { border-color:#acd7cb; box-shadow:0 12px 28px rgba(28,72,64,.1); }
.student-footer { background:#f1f7f5; border-top:1px solid #e3eeea; padding:25px 0; color:#68817c; }.student-footer .container { display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap; }.student-footer .brand { color:#1a655d; }.student-footer a { color:#47746d; margin-inline-start:14px; text-decoration:none; }
.account-menu-panel button { border:0;background:transparent;text-align:start;padding:9px 11px;border-radius:10px;color:var(--ink);font:inherit;cursor:pointer; }.account-menu-panel button:hover { background:#eff7f6; }
@media(max-width:760px) { .student-hero .hero-grid { grid-template-columns:1fr; }.hero-art { min-height:230px; order:-1; }.hero-art-card { height:210px;width:250px; }.art-house { width:110px;height:110px;font-size:4.4rem;top:28px; }.art-window { width:58px;height:58px; }.art-float-one { right:2%;top:8px; }.art-float-two { left:2%;bottom:8px; }.student-hero { padding-bottom:72px; }.student-content { padding-inline:14px; } }
@media(max-width:520px) { .student-topbar .container { min-height:64px; }.student-topbar .brand { font-size:1.2rem; }.student-topbar .userbox .name { display:none; }.student-topbar .userbox .btn { padding:6px 9px; }.student-footer .container { flex-direction:column;align-items:flex-start; } }

.student-topbar #userbox { display:none !important; }


/* ===== لوحة إدارة سكن: تنظيم بصري واضح وأولوية للشاشات الصغيرة ===== */
body[data-scope="admin"] {
  --ink:#18384e; --ink-2:#5d7485; --ink-3:#8496a3;
  --paper:#f3f7fa; --card:#ffffff; --line:#e1eaf0; --text:#183247;
  --teal:#13877d; --key:#f1c45b; --soft:#edf3f6; --skel:#eaf0f3;
  background:#f3f7fa; color:#183247;
}
html[data-theme="dark"] body[data-scope="admin"] {
  color-scheme:light;
  --ink:#18384e; --ink-2:#5d7485; --ink-3:#8496a3;
  --paper:#f3f7fa; --card:#ffffff; --line:#e1eaf0; --text:#183247;
  --teal:#13877d; --key:#f1c45b; --soft:#edf3f6; --skel:#eaf0f3;
  --ok:#17803d; --ok-bg:#e5f5ea; --warn:#8a5a00; --warn-bg:#fff3d6;
  --bad:#b42318; --bad-bg:#fde8e6; --info:#1d5fa8; --info-bg:#e4effb;
}
html[data-theme="dark"] body[data-scope="admin"] input,
html[data-theme="dark"] body[data-scope="admin"] select,
html[data-theme="dark"] body[data-scope="admin"] textarea { background:#fff; color:#183247; }
html[data-theme="dark"] body[data-scope="admin"] .hero { background:#f3f7fa; }
body[data-scope="admin"] .topbar { position:relative; top:auto; z-index:10; background:rgba(255,255,255,.96); border-bottom:1px solid #e2ebf0; box-shadow:0 4px 18px rgba(28,58,78,.045); }
body[data-scope="admin"] .topbar .container { min-height:72px; gap:12px; }
body[data-scope="admin"] .brand { color:#174b56; font-size:1.12rem; }
body[data-scope="admin"] main.container { max-width:1440px; }
body[data-scope="admin"] .admin-layout { display:grid; grid-template-columns:250px minmax(0,1fr); gap:22px; padding-block:24px 42px; align-items:start; }
body[data-scope="admin"] .side { position:sticky; top:16px; max-height:calc(100dvh - 32px); overflow:auto; overscroll-behavior:contain; padding:12px; border:1px solid #e1eaf0; border-radius:18px; background:#fff; box-shadow:0 8px 28px rgba(29,65,88,.055); }
body[data-scope="admin"] .side::before { content:"التنقل والإدارة"; display:block; padding:8px 12px 12px; margin-bottom:5px; color:#8294a1; font-size:.78rem; font-weight:700; border-bottom:1px solid #edf1f4; }
body[data-scope="admin"] .side button { position:relative; display:flex; align-items:center; justify-content:flex-start; gap:10px; width:100%; min-height:44px; margin:3px 0; padding:9px 12px; border:1px solid transparent; border-radius:11px; color:#536d7e; font-size:.9rem; font-weight:600; transition:background .16s,border-color .16s,color .16s; }
body[data-scope="admin"] .side button::before { content:"•"; flex:0 0 22px; width:22px; height:22px; display:grid; place-items:center; border-radius:7px; background:#f0f5f7; color:#6f8795; box-shadow:none; font-size:1rem; line-height:1; }
body[data-scope="admin"] .side button:nth-child(2)::before { content:"⌂"; }
body[data-scope="admin"] .side button:nth-child(3)::before { content:"✓"; }
body[data-scope="admin"] .side button:nth-child(4)::before { content:"▦"; }
body[data-scope="admin"] .side button:nth-child(5)::before { content:"ج"; }
body[data-scope="admin"] .side button:nth-child(6)::before { content:"⇄"; }
body[data-scope="admin"] .side button:nth-child(7)::before { content:"▣"; }
body[data-scope="admin"] .side button:nth-child(8)::before { content:"▤"; }
body[data-scope="admin"] .side button:nth-child(9)::before { content:"♙"; }
body[data-scope="admin"] .side button:nth-child(10)::before { content:"✉"; }
body[data-scope="admin"] .side button:nth-child(11)::before { content:"≋"; }
body[data-scope="admin"] .side button:nth-child(12)::before { content:"◉"; }
body[data-scope="admin"] .side button:nth-child(13)::before { content:"⌖"; }
body[data-scope="admin"] .side button:nth-child(14)::before { content:"♥"; }
body[data-scope="admin"] .side button:nth-child(15)::before { content:"⚙"; }
body[data-scope="admin"] .side button:nth-child(16)::before { content:"?"; }
body[data-scope="admin"] .side button:nth-child(17)::before { content:"▧"; }
body[data-scope="admin"] .side button:nth-child(18)::before { content:"⇄"; }
body[data-scope="admin"] .side button:hover { background:#f3f8fa; border-color:#e6eef2; color:#1b5960; }
body[data-scope="admin"] .side button.active { background:#eaf5f3; border-color:#cce6e0; color:#116b62; box-shadow:none; }
body[data-scope="admin"] .side button.active::before { background:#d8efea; color:#11766d; box-shadow:none; }
body[data-scope="admin"] .side .count { margin-inline-start:auto; }
body[data-scope="admin"] #content { min-width:0; padding:2px 0; }
body[data-scope="admin"] #content > h1 { color:#183e53; font-size:1.55rem !important; margin:0 0 8px; letter-spacing:-.02em; }
body[data-scope="admin"] #content > h2 { color:#234d60; margin:24px 0 12px; }
body[data-scope="admin"] #content > .muted { margin-bottom:18px; }
body[data-scope="admin"] #content .stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); gap:12px; margin:18px 0; }
body[data-scope="admin"] #content .stat { min-width:0; padding:17px 18px; border:1px solid #e2ebf0; border-radius:15px; background:#fff; box-shadow:0 4px 15px rgba(31,67,87,.035); }
body[data-scope="admin"] #content .stat .n { color:#176e68; font-size:1.65rem; font-weight:700; line-height:1.35; overflow-wrap:anywhere; }
body[data-scope="admin"] #content .panel { border-color:#e2ebf0; border-radius:16px; box-shadow:0 4px 16px rgba(31,67,87,.035); }
body[data-scope="admin"] #content .cards { grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr)); gap:14px; }
body[data-scope="admin"] #content .btn { border-radius:10px; }
body[data-scope="admin"] #content .table-wrap { border:1px solid #e2ebf0; border-radius:14px; background:#fff; }
body[data-scope="admin"] #content table { border:0; }
body[data-scope="admin"] #content th { background:#f3f7f9; color:#486477; }
body[data-scope="admin"] #gate { max-width:520px; margin:42px auto; }
body[data-scope="admin"] #gate h1 { color:#174b56; margin-bottom:8px; }
body[data-scope="admin"] #gate .panel { border-radius:18px; box-shadow:0 12px 35px rgba(29,65,88,.07); }
@media(max-width:900px) {
  body[data-scope="admin"] .admin-layout { grid-template-columns:minmax(0,1fr); gap:14px; padding-block:16px 32px; }
  body[data-scope="admin"] .side { position:relative; top:auto; max-height:none; display:flex; flex-wrap:nowrap; gap:6px; overflow-x:auto; padding:9px; border-radius:14px; scrollbar-width:thin; }
  body[data-scope="admin"] .side::before { display:none; }
  body[data-scope="admin"] .side button { flex:0 0 auto; width:auto; min-height:42px; margin:0; white-space:nowrap; padding:8px 12px; }
  body[data-scope="admin"] .side button::before { flex-basis:22px; width:22px; height:22px; }
}
@media(max-width:560px) {
  body[data-scope="admin"] .topbar .container { min-height:62px; flex-wrap:nowrap; }
  body[data-scope="admin"] .brand { font-size:1rem; }
  body[data-scope="admin"] .admin-layout { padding-top:12px; }
  body[data-scope="admin"] #content > h1 { font-size:1.3rem !important; }
  body[data-scope="admin"] #content .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  body[data-scope="admin"] #content .stat { padding:12px; }
  body[data-scope="admin"] #content .stat .n { font-size:1.35rem; }
  body[data-scope="admin"] #content .row { align-items:stretch; }
  body[data-scope="admin"] #content .row > .btn { flex:1 1 auto; }
}


/* قوائم وإشعارات الطالب */
.student-topbar { position:relative; }
.menu-badge,.menu-count { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:#c93636; color:#fff; font-size:11px; line-height:1; font-weight:800; vertical-align:middle; }
.menu-badge { margin-inline-start:5px; box-shadow:0 0 0 2px #fff; }
.menu-count { margin-inline-start:5px; }
.student-notif-panel { position:fixed; z-index:120; top:78px; inset-inline-end:max(14px,calc((100vw - 1180px)/2 + 14px)); width:min(390px,calc(100vw - 24px)); max-height:min(70vh,560px); overflow:hidden; background:#fff; color:#183447; border:1px solid #d8e5e8; border-radius:16px; box-shadow:0 18px 48px rgba(17,39,59,.2); }
.student-notif-head { display:flex; align-items:center; justify-content:space-between; padding:12px 15px; background:#f2f8f7; border-bottom:1px solid #dfe9e7; }
.student-notif-head button { border:0; background:transparent; color:#254a50; font-size:24px; cursor:pointer; }
.student-notif-list { max-height:calc(min(70vh,560px) - 52px); overflow:auto; padding:7px; }
.student-notif-item { width:100%; display:flex; gap:10px; align-items:flex-start; text-align:start; padding:12px 10px; border:0; border-bottom:1px solid #edf1f3; border-radius:10px; background:#fff; color:#1d3446; font:inherit; cursor:pointer; }
.student-notif-item:hover { background:#f3f8f7; }
.student-notif-item.unread { background:#fff8e8; }
.student-notif-mark { flex:0 0 22px; width:22px; height:22px; display:grid; place-items:center; border-radius:50%; background:#e8f2ef; color:#08786e; font-size:11px; margin-top:2px; }
.student-notif-item.unread .student-notif-mark { background:#c93636; color:#fff; }
.student-notif-copy { min-width:0; display:grid; gap:3px; }
.student-notif-copy b { color:#163a42; font-size:.94rem; }
.student-notif-copy > span { color:#405768; font-size:.88rem; line-height:1.6; }
.student-notif-copy small { color:#71818c; font-size:.76rem; }
.student-notif-empty { padding:24px 12px; text-align:center; }
.student-subpage .student-content { min-height:65vh; padding-top:24px; padding-bottom:70px; }
.student-subpage .student-content .results-head { margin-top:10px; margin-bottom:20px; }
.student-subpage #view-bookings,.student-subpage #view-contracts,.student-subpage #view-favorites { background:#fff; border:1px solid #e1eae8; border-radius:20px; padding:clamp(16px,3vw,28px); box-shadow:0 8px 28px rgba(24,63,57,.045); }
.subpage-back { display:inline-flex; align-items:center; gap:7px; color:#08786e; text-decoration:none; font-weight:700; margin-bottom:14px; padding:7px 11px; border-radius:10px; background:#eff7f5; }
.subpage-back:hover { background:#e1f0ec; }
.staff-message-row { display:flex; margin:10px 0; }
.staff-message-row.is-outgoing { justify-content:flex-end; }
.staff-message-row.is-incoming { justify-content:flex-start; }
.staff-message-bubble { max-width:min(85%,680px); min-width:160px; padding:11px 14px; border-radius:14px; box-shadow:0 2px 8px rgba(20,48,66,.07); overflow-wrap:anywhere; }
.staff-message-row.is-outgoing .staff-message-bubble { background:#08786e !important; color:#fff !important; border:1px solid #08786e !important; border-bottom-left-radius:4px; }
.staff-message-row.is-incoming .staff-message-bubble { background:#f1f6fa !important; color:#183447 !important; border:1px solid #d6e2eb !important; border-bottom-right-radius:4px; }
.staff-message-bubble b { display:block; margin-bottom:4px; color:inherit !important; }
.staff-message-text { white-space:pre-wrap; overflow-wrap:anywhere; color:inherit !important; line-height:1.75; }
.staff-message-bubble small { display:block; margin-top:6px; color:inherit !important; opacity:.78; font-size:.75rem; }
#staffchat-thread { background:#fff !important; color:#183447 !important; }
#staffchat-text { background:#fff !important; color:#183447 !important; }
@media(max-width:520px) { .student-notif-panel { top:70px; inset-inline:10px; width:auto; max-height:72vh; }.student-notif-list { max-height:calc(72vh - 52px); }.student-subpage .student-content { padding-inline:12px; }.staff-message-bubble { max-width:94%; } }
