/* ============================================================
   السقاف للمصاعد — لوحة التحكم
   الهوية: ذهب #FFCC00 · أسود #1A1A1A · خط Cairo
   Bootstrap 5.3 — بدون قوالب Monster/Admin القديمة
   ============================================================ */

:root {
  --sg-gold: #ffcc00;
  --sg-gold-dark: #fdb813;
  --sg-gold-light: #ffe066;
  --sg-gold-soft: #fff6d8;
  --sg-ink: #1a1a1a;
  --sg-ink-soft: #252525;
  --sg-mute: #6b7280;
  --sg-line: #e5e7eb;
  --sg-bg: #f5f6f8;
  --sg-surface: #ffffff;
  --sg-danger: #e53935;
  --sg-success: #43a047;
  --sg-sidebar-w: 280px;
  --sg-topbar-h: 64px;
  --sg-radius: 14px;
  --sg-shadow: 0 4px 20px rgba(26, 26, 26, 0.06);
  --sg-shadow-lg: 0 10px 40px rgba(26, 26, 26, 0.1);
  --bs-primary: #ffcc00;
  --bs-primary-rgb: 255, 204, 0;
  --bs-body-font-family: "Cairo", system-ui, sans-serif;
  --bs-body-color: #1a1a1a;
  --bs-body-bg: #f5f6f8;
  --bs-border-radius: 10px;
  --bs-link-color: #1a1a1a;
  --bs-link-hover-color: #fdb813;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "Cairo", system-ui, sans-serif;
  background: var(--sg-bg);
  color: var(--sg-ink);
  overflow-x: hidden;
}

body.sg-sidebar-open {
  overflow: hidden;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ---------- Preloader ---------- */
.sg-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(160deg, #fff 0%, var(--sg-gold-soft) 55%, var(--sg-gold) 100%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.sg-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sg-preloader__logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(26, 26, 26, 0.15));
  animation: sg-pulse 1.4s ease-in-out infinite;
}

.sg-preloader__label {
  margin: 0;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--sg-ink);
  letter-spacing: 0.02em;
}

.sg-preloader__bar {
  width: 120px;
  height: 3px;
  border-radius: 99px;
  background: rgba(26, 26, 26, 0.12);
  overflow: hidden;
}

.sg-preloader__bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--sg-ink);
  animation: sg-bar 1.1s ease-in-out infinite;
}

@keyframes sg-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes sg-bar {
  0% {
    transform: translateX(200%);
  }
  100% {
    transform: translateX(-250%);
  }
}

/* ---------- App shell ---------- */
.sg-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Topbar ---------- */
.sg-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--sg-topbar-h);
  background: var(--sg-surface);
  border-bottom: 1px solid var(--sg-line);
  box-shadow: 0 1px 0 rgba(255, 204, 0, 0.35), var(--sg-shadow);
}

.sg-topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
}

.sg-topbar__start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.sg-menu-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--sg-line);
  background: var(--sg-bg);
  color: var(--sg-ink);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.sg-menu-btn:hover {
  background: var(--sg-gold-soft);
  border-color: var(--sg-gold);
  color: var(--sg-ink);
}

.sg-menu-btn:active {
  transform: scale(0.97);
}

.sg-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: inherit;
}

.sg-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: none;
}

.sg-brand__mark img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sg-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.sg-brand__name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--sg-ink);
  white-space: nowrap;
}

.sg-brand__tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sg-mute);
  white-space: nowrap;
}

.sg-welcome {
  display: none;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: var(--sg-mute);
  font-weight: 600;
  white-space: nowrap;
}

.sg-welcome strong {
  color: var(--sg-ink);
  font-weight: 800;
}

.sg-topbar__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sg-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sg-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sg-icon-btn:hover {
  background: var(--sg-bg);
  color: var(--sg-ink);
  border-color: var(--sg-line);
}

.sg-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--sg-line);
  background: var(--sg-surface);
  color: var(--sg-ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sg-user:hover,
.sg-user.show {
  border-color: var(--sg-gold);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2);
}

.sg-user__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--sg-gold-soft);
  border: 2px solid var(--sg-gold);
}

.sg-user__meta {
  display: none;
  flex-direction: column;
  line-height: 1.15;
  text-align: start;
}

.sg-user__name {
  font-size: 0.82rem;
  font-weight: 800;
}

.sg-user__role {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--sg-mute);
}

.sg-dropdown-menu {
  --bs-dropdown-min-width: 220px;
  --bs-dropdown-border-radius: 14px;
  --bs-dropdown-border-color: var(--sg-line);
  --bs-dropdown-padding-y: 0.5rem;
  box-shadow: var(--sg-shadow-lg);
  font-size: 0.92rem;
}

.sg-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  font-weight: 600;
  color: var(--sg-ink);
}

.sg-dropdown-menu .dropdown-item i {
  color: var(--sg-mute);
}

.sg-dropdown-menu .dropdown-item:hover,
.sg-dropdown-menu .dropdown-item:focus {
  background: var(--sg-gold-soft);
  color: var(--sg-ink);
}

.sg-dropdown-menu .dropdown-item:hover i {
  color: var(--sg-ink);
}

.sg-dropdown-menu .dropdown-item.text-danger i {
  color: var(--sg-danger);
}

/* ---------- Layout body ---------- */
.sg-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* ---------- Sidebar ---------- */
.sg-sidebar {
  position: fixed;
  top: var(--sg-topbar-h);
  right: 0;
  bottom: 0;
  width: var(--sg-sidebar-w);
  z-index: 1025;
  background: var(--sg-ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
}

.sg-sidebar.is-open {
  transform: translateX(0);
}

.sg-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.15rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sg-sidebar__brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.sg-sidebar__brand-text strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.sg-sidebar__brand-text span {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.sg-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sg-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.85rem 0.65rem;
}

.sg-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sg-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.18s, color 0.18s, transform 0.15s;
}

.sg-nav a i {
  width: 1.35rem;
  font-size: 1.1rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.18s;
}

.sg-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sg-nav a:hover i {
  color: var(--sg-gold);
}

.sg-nav a.active,
.sg-nav a:focus-visible {
  background: linear-gradient(90deg, var(--sg-gold), var(--sg-gold-dark));
  color: var(--sg-ink);
  box-shadow: 0 6px 18px rgba(255, 204, 0, 0.28);
}

.sg-nav a.active i,
.sg-nav a:focus-visible i {
  color: var(--sg-ink);
}

.sg-sidebar__foot {
  padding: 0.85rem 1rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sg-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sg-logout-btn:hover {
  background: rgba(229, 57, 53, 0.15);
  border-color: rgba(229, 57, 53, 0.45);
  color: #ff8a80;
}

.sg-backdrop {
  position: fixed;
  inset: var(--sg-topbar-h) 0 0 0;
  background: rgba(26, 26, 26, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1020;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.sg-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* ---------- Main content ---------- */
.sg-main {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem 1.75rem;
  gap: 1.25rem;
  background: var(--sg-bg);
}

.sg-main__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  flex: 1;
  padding: 0;
}

/* Page helpers for child pages */
.sg-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sg-page-head h1,
.sg-page-head .sg-page-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--sg-ink);
}

.sg-page-head p {
  margin: 0.25rem 0 0;
  color: var(--sg-mute);
  font-weight: 600;
  font-size: 0.9rem;
}

.sg-card {
  background: var(--sg-surface);
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius);
  box-shadow: var(--sg-shadow);
}

.sg-card .card-header,
.sg-card-header {
  background: transparent;
  border-bottom: 1px solid var(--sg-line);
  padding: 1rem 1.15rem;
  font-weight: 800;
}

.sg-card .card-body,
.sg-card-body {
  padding: 1.15rem;
}

.sg-stat {
  background: var(--sg-surface);
  border: 1px solid var(--sg-line);
  border-radius: var(--sg-radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--sg-shadow);
  position: relative;
  overflow: hidden;
}

.sg-stat::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sg-gold), var(--sg-gold-dark));
}

.sg-stat__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sg-mute);
  margin-bottom: 0.35rem;
}

.sg-stat__value {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--sg-ink);
  line-height: 1.2;
}

.btn {
  font-weight: 700;
  border-radius: 12px;
  --bs-btn-padding-y: 0.55rem;
  --bs-btn-padding-x: 1.1rem;
}

.btn-primary {
  --bs-btn-color: #1a1a1a;
  --bs-btn-bg: #ffcc00;
  --bs-btn-border-color: #ffcc00;
  --bs-btn-hover-color: #1a1a1a;
  --bs-btn-hover-bg: #fdb813;
  --bs-btn-hover-border-color: #fdb813;
  --bs-btn-focus-shadow-rgb: 255, 204, 0;
  --bs-btn-active-color: #1a1a1a;
  --bs-btn-active-bg: #f0b800;
  --bs-btn-active-border-color: #f0b800;
  --bs-btn-disabled-color: #1a1a1a;
  --bs-btn-disabled-bg: #ffe066;
  --bs-btn-disabled-border-color: #ffe066;
}

.btn-dark,
.btn-secondary {
  --bs-btn-bg: #1a1a1a;
  --bs-btn-border-color: #1a1a1a;
  --bs-btn-hover-bg: #252525;
  --bs-btn-hover-border-color: #252525;
  --bs-btn-active-bg: #000;
  --bs-btn-active-border-color: #000;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
}

.btn-outline-dark {
  --bs-btn-color: #1a1a1a;
  --bs-btn-border-color: #1a1a1a;
  --bs-btn-hover-bg: #1a1a1a;
  --bs-btn-hover-border-color: #1a1a1a;
  --bs-btn-hover-color: #fff;
}

.form-control,
.form-select {
  border-radius: 12px;
  border-color: var(--sg-line);
  padding: 0.65rem 0.9rem;
  font-weight: 600;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--sg-gold);
  box-shadow: 0 0 0 0.2rem rgba(255, 204, 0, 0.25);
}

.form-label {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.table {
  --bs-table-bg: transparent;
  font-weight: 600;
}

.table thead th {
  font-weight: 800;
  color: var(--sg-mute);
  font-size: 0.8rem;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.badge {
  font-weight: 700;
}

.badge-sg {
  background: var(--sg-gold-soft);
  color: var(--sg-ink);
  border: 1px solid rgba(255, 204, 0, 0.45);
}

/* ---------- Overlay loader ---------- */
#loader_main1 {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(245, 246, 248, 0.72);
  backdrop-filter: blur(4px);
}

#loader_main1.is-visible {
  display: flex;
}

#loader_main1 img {
  width: 72px;
  height: 72px;
}

#loadingtxt {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sg-ink);
  margin: 0;
}

/* ---------- Footer ---------- */
.sg-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sg-mute);
  border-top: 1px solid var(--sg-line);
  background: var(--sg-surface);
}

.sg-footer strong {
  color: var(--sg-ink);
}

/* ---------- Modal ---------- */
.modal-content {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--sg-shadow-lg);
}

.modal-header {
  background: linear-gradient(135deg, var(--sg-gold-soft), #fff);
  border-bottom: 1px solid var(--sg-line);
  padding: 1rem 1.25rem;
}

.modal-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.modal-body {
  padding: 1.25rem;
}

.sg-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--sg-line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sg-mute);
}

.sg-modal-close:hover {
  color: var(--sg-ink);
  border-color: var(--sg-gold);
}

/* Select2 / DataTables soft overrides */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border-radius: 12px !important;
  border-color: var(--sg-line) !important;
  min-height: 42px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border-radius: 10px;
  border: 1px solid var(--sg-line);
  padding: 0.35rem 0.65rem;
}

/* ---------- Desktop ---------- */
@media (min-width: 992px) {
  .sg-sidebar {
    position: sticky;
    top: var(--sg-topbar-h);
    height: calc(100vh - var(--sg-topbar-h));
    transform: none;
    flex-shrink: 0;
    box-shadow: none;
    border-left: 1px solid rgba(255, 255, 255, 0.04);
  }

  .sg-backdrop {
    display: none !important;
  }

  .sg-menu-btn.sg-menu-btn--mobile {
    display: none;
  }

  .sg-welcome {
    display: flex;
  }

  .sg-user__meta {
    display: flex;
  }

  .sg-brand {
    display: none;
  }

  .sg-main {
    padding: 1.75rem 2rem 2.25rem;
  }

  body.sg-sidebar-collapsed .sg-sidebar {
    width: 84px;
  }

  body.sg-sidebar-collapsed .sg-sidebar__brand-text,
  body.sg-sidebar-collapsed .sg-nav-label,
  body.sg-sidebar-collapsed .sg-nav a span,
  body.sg-sidebar-collapsed .sg-logout-btn span {
    display: none;
  }

  body.sg-sidebar-collapsed .sg-nav a {
    justify-content: center;
    padding: 0.85rem;
  }

  body.sg-sidebar-collapsed .sg-sidebar__brand {
    justify-content: center;
  }

  body.sg-sidebar-collapsed .sg-logout-btn {
    padding: 0.75rem;
  }
}

@media (max-width: 991.98px) {
  .sg-brand__tag {
    display: none;
  }
}

@media (min-width: 1400px) {
  .sg-main {
    padding: 2rem 2.5rem 2.5rem;
  }
}

.sg-main > .sg-footer {
  margin-top: auto;
  border-radius: 12px;
}

.Rounded2024 {
  border-radius: 18px !important;
}

/* ---------- List / form / preview pages ---------- */
.sg-table {
  width: 100% !important;
  margin: 0;
}

.sg-table thead th {
  background: var(--sg-ink);
  color: #fff !important;
  border: 0 !important;
  padding: 0.85rem 0.75rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.sg-table tbody td {
  padding: 0.8rem 0.75rem;
  vertical-align: middle;
  border-color: var(--sg-line);
  font-weight: 600;
}

.sg-table tbody tr:hover {
  background: var(--sg-gold-soft);
}

.sg-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.sg-actions a,
.sg-action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sg-line);
  background: #fff;
  color: var(--sg-ink);
  transition: all 0.15s;
}

.sg-actions a:hover,
.sg-action:hover {
  border-color: var(--sg-gold);
  background: var(--sg-gold-soft);
  color: var(--sg-ink);
}

.sg-actions a.sg-action-danger,
.sg-action-danger {
  color: var(--sg-danger);
}

.sg-actions a.sg-action-danger:hover {
  background: #ffebee;
  border-color: #ffcdd2;
}

.dataTables_wrapper {
  padding-top: 0.25rem;
}

.dataTables_wrapper .dt-buttons {
  margin-bottom: 0.75rem;
}

.dataTables_wrapper .dt-buttons .btn,
.dataTables_wrapper .dt-buttons .dt-button {
  border-radius: 10px !important;
  font-weight: 700 !important;
  margin: 0 0.25rem 0.35rem 0 !important;
  background: var(--sg-ink) !important;
  color: #fff !important;
  border: 0 !important;
  padding: 0.4rem 0.85rem !important;
}

.dataTables_wrapper .dataTables_filter input {
  border-radius: 10px;
  border: 1px solid var(--sg-line);
  padding: 0.4rem 0.75rem;
  margin-right: 0.5rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding-top: 0.85rem;
  font-weight: 600;
  color: var(--sg-mute);
}

.dataTables_wrapper .paginate_button.current,
.dataTables_wrapper .page-item.active .page-link {
  background: var(--sg-gold) !important;
  border-color: var(--sg-gold) !important;
  color: var(--sg-ink) !important;
}

.sg-form-grid .form-label {
  font-weight: 700;
  color: var(--sg-ink);
}

.sg-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sg-line);
}

.sg-upload {
  border: 1px dashed var(--sg-line);
  border-radius: var(--sg-radius);
  background: var(--sg-bg);
  padding: 1rem;
  text-align: center;
}

.sg-upload img {
  max-width: 180px;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--sg-gold);
  cursor: pointer;
  background: #fff;
}

.sg-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.sg-preview-item {
  background: var(--sg-bg);
  border: 1px solid var(--sg-line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.sg-preview-item .lbl {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sg-mute);
  margin-bottom: 0.25rem;
}

.sg-preview-item .val {
  font-weight: 800;
  color: var(--sg-ink);
  word-break: break-word;
}

.sg-map {
  width: 100%;
  min-height: 280px;
  border-radius: var(--sg-radius);
  border: 1px solid var(--sg-line);
  overflow: hidden;
  background: var(--sg-bg);
}

#map {
  width: 100%;
  min-height: 280px;
  border-radius: var(--sg-radius);
}

.dt-center {
  text-align: center;
}

img.img-fluid {
  max-height: 56px;
  width: auto;
  border-radius: 8px;
  object-fit: cover;
}

/* ============================================================
   وحي من الخيال — غلاف برج السقاف
   ============================================================ */

body.sg-dream {
  --sg-bg: #ece8df;
  --sg-topbar-h: 72px;
  --sg-sidebar-w: 292px;
  background:
    radial-gradient(ellipse 90% 60% at 10% -10%, rgba(255, 204, 0, 0.22), transparent 50%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(26, 26, 26, 0.08), transparent 45%),
    linear-gradient(180deg, #f7f3ea 0%, #ebe6dc 40%, #e4dfd4 100%);
}

.sg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sg-atmosphere__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 204, 0, 0.12), transparent 35%),
    radial-gradient(circle at 15% 80%, rgba(26, 26, 26, 0.06), transparent 40%);
}

.sg-atmosphere__shafts {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 72px,
      rgba(26, 26, 26, 0.035) 72px,
      rgba(26, 26, 26, 0.035) 73px
    );
  mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}

.sg-atmosphere__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: sg-orb-drift 16s ease-in-out infinite alternate;
}

.sg-atmosphere__orb--a {
  width: 280px;
  height: 280px;
  top: -60px;
  left: 8%;
  background: rgba(255, 204, 0, 0.35);
}

.sg-atmosphere__orb--b {
  width: 220px;
  height: 220px;
  bottom: 8%;
  right: 18%;
  background: rgba(26, 26, 26, 0.12);
  animation-delay: -6s;
}

.sg-atmosphere__dust span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(253, 184, 19, 0.55);
  animation: sg-dust-rise linear infinite;
}

@keyframes sg-orb-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(24px, 18px, 0) scale(1.08); }
}

@keyframes sg-dust-rise {
  0% { transform: translateY(20px); opacity: 0; }
  15% { opacity: 0.8; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

body.sg-dream .sg-app {
  position: relative;
  z-index: 1;
}

/* Preloader dream */
body.sg-dream .sg-preloader {
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 204, 0, 0.35), transparent 45%),
    linear-gradient(160deg, #0f0f0f 0%, #1a1a1a 50%, #111 100%);
  color: #fff;
}

body.sg-dream .sg-preloader__label {
  color: #fff;
}

body.sg-dream .sg-preloader__whisper {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

body.sg-dream .sg-preloader__bar {
  background: rgba(255, 255, 255, 0.12);
}

body.sg-dream .sg-preloader__bar span {
  background: linear-gradient(90deg, #ffcc00, #fff);
}

.sg-preloader__orbit {
  position: absolute;
  width: 180px;
  height: 180px;
}

.sg-preloader__orbit span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 204, 0, 0.2);
  animation: sg-orbit-spin 4s linear infinite;
}

.sg-preloader__orbit span:nth-child(2) {
  inset: 16px;
  animation-duration: 6s;
  animation-direction: reverse;
  border-color: rgba(255, 255, 255, 0.12);
}

.sg-preloader__orbit span:nth-child(3) {
  inset: 32px;
  animation-duration: 3.2s;
  border-color: rgba(255, 204, 0, 0.35);
}

@keyframes sg-orbit-spin {
  to { transform: rotate(360deg); }
}

.sg-preloader__shaft {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 120px;
  border-radius: 18px;
  border: 1px solid rgba(255, 204, 0, 0.35);
  background: linear-gradient(180deg, rgba(255, 204, 0, 0.12), rgba(255, 255, 255, 0.04));
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255, 204, 0, 0.15);
}

.sg-preloader__cabin {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ffcc00, #fdb813);
  animation: sg-cabin-ride 1.8s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.55);
}

@keyframes sg-cabin-ride {
  0%, 100% { top: 12px; }
  50% { top: calc(100% - 30px); }
}

/* Topbar glass */
body.sg-dream .sg-topbar {
  height: var(--sg-topbar-h);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 204, 0, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 10px 30px rgba(26, 26, 26, 0.06);
}

.sg-topbar__glow {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(90deg, rgba(255, 204, 0, 0.18), transparent);
  pointer-events: none;
}

body.sg-dream .sg-topbar__inner {
  position: relative;
  z-index: 1;
  padding: 0 1.4rem;
}

.sg-topbar__motto {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.04);
  border: 1px solid rgba(255, 204, 0, 0.35);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sg-ink);
}

.sg-topbar__motto i { color: #fdb813; }

.sg-clock {
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #1a1a1a;
  color: #ffcc00;
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

body.sg-dream .sg-welcome__place {
  color: rgba(26, 26, 26, 0.55);
}

body.sg-dream .sg-menu-btn {
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #fff6d8);
  border-color: rgba(255, 204, 0, 0.45);
}

body.sg-dream .sg-brand__mark {
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  animation: none;
}

/* Sidebar tower */
body.sg-dream .sg-sidebar {
  background:
    linear-gradient(180deg, rgba(255, 204, 0, 0.08), transparent 28%),
    linear-gradient(165deg, #121212 0%, #1a1a1a 45%, #0e0e0e 100%);
  border-left: 1px solid rgba(255, 204, 0, 0.18);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.28);
}

.sg-sidebar__rail {
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 10px;
  width: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sg-sidebar__cabin {
  position: absolute;
  left: 0;
  right: 0;
  height: 42px;
  border-radius: 99px;
  background: linear-gradient(180deg, #ffcc00, #fdb813);
  box-shadow: 0 0 14px rgba(255, 204, 0, 0.55);
  top: 12%;
  transition: top 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

body.sg-dream .sg-sidebar__brand {
  padding-right: 1.15rem;
  padding-left: 1.4rem;
  border-bottom-color: rgba(255, 204, 0, 0.12);
}

.sg-sidebar__logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.sg-sidebar__logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

body.sg-dream .sg-sidebar__brand img {
  width: auto;
  height: auto;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

body.sg-dream .sg-sidebar__nav {
  padding-left: 1.15rem;
}

body.sg-dream .sg-nav-label {
  color: rgba(255, 204, 0, 0.55);
  letter-spacing: 0.12em;
}

body.sg-dream .sg-nav a {
  border: 1px solid transparent;
  position: relative;
}

body.sg-dream .sg-nav a:hover {
  background: rgba(255, 204, 0, 0.08);
  border-color: rgba(255, 204, 0, 0.12);
}

body.sg-dream .sg-nav a.active,
body.sg-dream .sg-nav a:focus-visible {
  background: linear-gradient(105deg, #ffcc00 0%, #fdb813 70%, #ffe066 100%);
  color: #1a1a1a;
  transform: translateX(-2px);
}

.sg-sidebar__quote {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.sg-sidebar__quote i {
  color: #ffcc00;
  font-size: 1rem;
}

/* Main stage */
body.sg-dream .sg-main {
  background: transparent;
  padding: 1.5rem 1.35rem 1.5rem;
}

.sg-main__frame {
  flex: 1;
  min-width: 0;
  border-radius: 22px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(255, 204, 0, 0.55), rgba(255, 255, 255, 0.2), rgba(26, 26, 26, 0.12)) border-box;
  border: 1px solid transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 18px 50px rgba(26, 26, 26, 0.08);
  padding: 1.25rem 1.25rem 1.4rem;
  animation: sg-frame-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sg-frame-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

body.sg-dream .sg-main__inner {
  max-width: 1360px;
}

body.sg-dream .sg-main > .sg-footer {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 204, 0, 0.25);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.sg-footer__mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffcc00;
  box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.2);
}

.sg-footer__sep { opacity: 0.4; }

body.sg-dream .sg-footer em {
  font-style: normal;
  font-weight: 800;
  color: var(--sg-ink);
  background: linear-gradient(90deg, #1a1a1a, #8a6d00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (min-width: 992px) {
  body.sg-dream .sg-sidebar {
    overflow: hidden;
  }
}

body.sg-sidebar-collapsed .sg-sidebar__rail,
body.sg-sidebar-collapsed .sg-sidebar__quote,
body.sg-sidebar-collapsed .sg-sidebar__brand-text {
  display: none;
}

@media (max-width: 991.98px) {
  .sg-sidebar__rail { display: none; }
  body.sg-dream .sg-sidebar__nav { padding-left: 0.85rem; }
  .sg-main__frame { padding: 1rem; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-atmosphere__orb,
  .sg-preloader__orbit span,
  .sg-preloader__cabin,
  .sg-brand__mark,
  .sg-atmosphere__dust span {
    animation: none !important;
  }
}
