/* =========================================================================
   لوحة التحكم — نظام التصميم (RTL)
   Loaded after Bootstrap 4 / SB Admin 2. Restyles shared Bootstrap components
   so existing screens inherit the new look, and adds the app shell.
   ========================================================================= */

:root {
  --c-primary: #0f766e;
  --c-primary-600: #0d6660;
  --c-primary-50: #e6f4f2;
  --c-accent: #b45309;
  --c-success: #15803d;
  --c-success-50: #e8f5ec;
  --c-warning: #b45309;
  --c-warning-50: #fdf3e4;
  --c-danger: #b91c1c;
  --c-danger-50: #fcebeb;
  --c-info: #1d4ed8;
  --c-info-50: #e8eefc;

  --c-bg: #f4f6f8;
  --c-surface: #ffffff;
  --c-surface-2: #f8fafb;
  --c-border: #e3e8ec;
  --c-text: #1d2733;
  --c-text-muted: #5f6b78;
  --c-text-faint: #8a95a1;

  --c-sidebar: #10231f;
  --c-sidebar-2: #173129;
  --c-sidebar-text: #c9d6d2;
  --c-sidebar-muted: #7e958f;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 31, .06);
  --shadow: 0 1px 3px rgba(16, 35, 31, .08), 0 4px 14px rgba(16, 35, 31, .05);
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

/* ---------- Base ---------- */
html { font-size: 15px; }
body, .tooltip, .popover, .swal-modal, .swal2-popup {
  font-family: var(--font) !important;
}
body {
  background: var(--c-bg);
  color: var(--c-text);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--c-text); font-weight: 600; }
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-600); }
.text-muted { color: var(--c-text-muted) !important; }
.text-primary { color: var(--c-primary) !important; }
.bg-primary { background-color: var(--c-primary) !important; }
:focus-visible { outline: 3px solid rgba(15, 118, 110, .35); outline-offset: 2px; }
.num, .ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

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

.app-sidebar {
  position: fixed;
  inset-block: 0;
  right: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--c-sidebar) 0%, var(--c-sidebar-2) 100%);
  color: var(--c-sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}
.app-sidebar__brand {
  display: flex; align-items: center; gap: .7rem;
  height: var(--topbar-h);
  padding: 0 1.25rem;
  color: #fff !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  flex-shrink: 0;
}
.app-sidebar__logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(255, 255, 255, .1);
  display: grid; place-items: center; overflow: hidden;
}
.app-sidebar__logo img { width: 100%; height: 100%; object-fit: contain; }
.app-sidebar__name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.app-sidebar__name small { display: block; font-weight: 400; font-size: .75rem; color: var(--c-sidebar-muted); }

.app-nav { flex: 1; overflow-y: auto; padding: .75rem .75rem 1.5rem; scrollbar-width: thin; }
.app-nav__heading {
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  color: var(--c-sidebar-muted);
  padding: 1rem .75rem .4rem;
}
.app-nav__link {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--c-sidebar-text) !important;
  text-decoration: none !important;
  font-size: .93rem;
  transition: background .15s, color .15s;
}
.app-nav__link i { width: 1.25rem; text-align: center; font-size: .95rem; color: var(--c-sidebar-muted); transition: color .15s; }
.app-nav__link:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }
.app-nav__link:hover i { color: #fff; }
.app-nav__link.is-active { background: rgba(94, 234, 212, .12); color: #fff !important; font-weight: 600; }
.app-nav__link.is-active i { color: #5eead4; }
.app-nav__link .app-nav__chev { margin-inline-start: auto; font-size: .7rem; transition: transform .2s; }
.app-nav__link[aria-expanded="true"] .app-nav__chev { transform: rotate(-90deg); }
.app-nav__sub { padding: .15rem 0 .35rem; margin-inline-start: 1.95rem; border-inline-start: 1px solid rgba(255, 255, 255, .08); }
.app-nav__sub a {
  display: block; padding: .42rem .9rem; font-size: .87rem;
  color: var(--c-sidebar-muted) !important; text-decoration: none !important; border-radius: 6px;
}
.app-nav__sub a:hover, .app-nav__sub a.is-active { color: #fff !important; background: rgba(255, 255, 255, .05); }

.app-main {
  flex: 1;
  min-width: 0;
  margin-right: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.app-topbar__toggle { display: none; }
.app-topbar__title { font-weight: 600; font-size: 1rem; color: var(--c-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: .35rem; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-grid; place-items: center;
  border: 0; background: transparent; color: var(--c-text-muted) !important;
  text-decoration: none !important;
}
.icon-btn:hover { background: var(--c-surface-2); color: var(--c-text) !important; }
.icon-btn .badge-dot {
  position: absolute; top: 6px; left: 6px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--c-danger); color: #fff; font-size: .68rem; line-height: 18px; text-align: center;
}
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .3rem .5rem; border-radius: 10px; color: var(--c-text) !important; text-decoration: none !important; }
.user-chip:hover { background: var(--c-surface-2); }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c-primary-50); }
.user-chip span { font-size: .9rem; font-weight: 500; }

.app-content { flex: 1; padding: 1.5rem; }
.app-content > .container-fluid { padding-left: 0 !important; padding-right: 0 !important; }
.app-footer { padding: 1rem 1.5rem; color: var(--c-text-faint); font-size: .82rem; border-top: 1px solid var(--c-border); background: var(--c-surface); }

.app-overlay { display: none; }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(100%); box-shadow: none; }
  .app.sidebar-open .app-sidebar { transform: translateX(0); box-shadow: -8px 0 30px rgba(0, 0, 0, .25); }
  .app-main { margin-right: 0; }
  .app-topbar { padding: 0 .75rem; }
  .app-topbar__toggle { display: inline-grid; }
  .app-content { padding: 1rem .75rem; }
  .app.sidebar-open .app-overlay { display: block; position: fixed; inset: 0; background: rgba(16, 35, 31, .45); z-index: 1035; }
  .user-chip span { display: none; }
}

/* ---------- Page header ---------- */
.page-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
  margin-bottom: 1.25rem;
}
.page-head__title { margin: 0; font-size: 1.35rem; font-weight: 700; }
.page-head__subtitle { margin: .2rem 0 0; color: var(--c-text-muted); font-size: .9rem; }
.page-head__actions { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.breadcrumb-lite { font-size: .8rem; color: var(--c-text-faint); margin-bottom: .2rem; }
.breadcrumb-lite a { color: var(--c-text-faint); }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--c-border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
  background: var(--c-surface);
}
.card.shadow { box-shadow: var(--shadow-sm) !important; }
.card-header {
  background: var(--c-surface) !important;
  border-bottom: 1px solid var(--c-border) !important;
  padding: .9rem 1.15rem !important;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-header h6, .card-header .m-0 { color: var(--c-text) !important; font-weight: 600; font-size: .98rem; }
.card-body { padding: 1.15rem; }
.card-footer { background: var(--c-surface-2); border-top: 1px solid var(--c-border); }
.border-left-primary, .border-left-success, .border-left-info, .border-left-warning, .border-left-danger { border-left: 1px solid var(--c-border) !important; }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-bottom: 1.25rem; }
.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex; gap: .9rem; align-items: flex-start;
  box-shadow: var(--shadow-sm);
  color: inherit !important; text-decoration: none !important;
  transition: border-color .15s, box-shadow .15s;
}
a.stat:hover { border-color: #c6d3d0; box-shadow: var(--shadow); }
.stat__icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.05rem; }
.stat__label { font-size: .84rem; color: var(--c-text-muted); margin-bottom: .2rem; }
.stat__value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; color: var(--c-text); }
.stat__hint { font-size: .78rem; color: var(--c-text-faint); margin-top: .25rem; }
.tone-primary { background: var(--c-primary-50); color: var(--c-primary); }
.tone-success { background: var(--c-success-50); color: var(--c-success); }
.tone-warning { background: var(--c-warning-50); color: var(--c-warning); }
.tone-danger { background: var(--c-danger-50); color: var(--c-danger); }
.tone-info { background: var(--c-info-50); color: var(--c-info); }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--radius-sm) !important; font-weight: 500; font-size: .9rem; padding: .5rem 1rem; box-shadow: none !important; }
.btn-sm { padding: .32rem .7rem; font-size: .82rem; }
.btn i + span, .btn span + i { margin-inline-start: .35rem; }
.btn-primary { background: var(--c-primary) !important; border-color: var(--c-primary) !important; color: #fff !important; }
.btn-primary:hover, .btn-primary:focus { background: var(--c-primary-600) !important; border-color: var(--c-primary-600) !important; }
.btn-success { background: var(--c-success) !important; border-color: var(--c-success) !important; color: #fff !important; }
.btn-danger { background: var(--c-danger) !important; border-color: var(--c-danger) !important; color: #fff !important; }
.btn-warning { background: var(--c-warning) !important; border-color: var(--c-warning) !important; color: #fff !important; }
.btn-info { background: var(--c-info) !important; border-color: var(--c-info) !important; color: #fff !important; }
.btn-secondary, .btn-light { background: var(--c-surface) !important; border: 1px solid var(--c-border) !important; color: var(--c-text) !important; }
.btn-secondary:hover, .btn-light:hover { background: var(--c-surface-2) !important; }
.btn-outline-primary { color: var(--c-primary) !important; border-color: var(--c-primary) !important; }
.btn-outline-primary:hover { background: var(--c-primary) !important; color: #fff !important; }
.btn-icon { width: 34px; height: 34px; padding: 0 !important; display: inline-grid !important; place-items: center; }
.btn-circle { border-radius: 8px !important; }
.btn-ghost { background: transparent !important; border: 1px solid transparent !important; color: var(--c-text-muted) !important; }
.btn-ghost:hover { background: var(--c-surface-2) !important; color: var(--c-text) !important; }
.btn-ghost.danger:hover { background: var(--c-danger-50) !important; color: var(--c-danger) !important; }

/* ---------- Forms ---------- */
label, .col-form-label { font-weight: 500; font-size: .88rem; color: var(--c-text); margin-bottom: .35rem; }
.form-control, .custom-select, select.form-control {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  min-height: 40px;
  font-size: .92rem;
  color: var(--c-text);
  background-color: var(--c-surface);
}
.form-control:focus, .custom-select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }
.form-control::placeholder { color: var(--c-text-faint); }
.form-text { color: var(--c-text-faint); font-size: .8rem; }
.invalid-feedback, .text-danger { color: var(--c-danger) !important; }
.is-invalid { border-color: var(--c-danger) !important; }
.custom-select { background-position: left .75rem center; padding-left: 2rem; padding-right: .75rem; }
.input-group > .form-control:not(:last-child) { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group > .input-group-append > .btn, .input-group > .input-group-append > .input-group-text { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.input-group > .input-group-prepend > .btn, .input-group > .input-group-prepend > .input-group-text { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }
.form-section { border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); margin-bottom: 1rem; }
.form-section__head { padding: .85rem 1.1rem; border-bottom: 1px solid var(--c-border); font-weight: 600; }
.form-section__body { padding: 1.1rem; }
.required::after { content: " *"; color: var(--c-danger); }

/* ---------- Filters bar ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; padding: .9rem 1.1rem; border-bottom: 1px solid var(--c-border); background: var(--c-surface-2); }
.filters .form-group { margin: 0; min-width: 160px; flex: 1 1 160px; }
.filters .form-group.grow { flex: 2 1 240px; }
.filters label { font-size: .78rem; color: var(--c-text-muted); }

/* ---------- Tables ---------- */
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.table { color: var(--c-text) !important; font-size: .9rem; margin-bottom: 0; }
.table th, .table td { padding: .7rem .9rem !important; vertical-align: middle !important; border-color: var(--c-border) !important; text-align: right; }
.table thead th {
  background: var(--c-surface-2);
  color: var(--c-text-muted);
  font-weight: 600; font-size: .8rem;
  border-bottom: 1px solid var(--c-border) !important;
  white-space: nowrap;
}
.table-bordered { border: 0 !important; }
.table-bordered th, .table-bordered td { border-width: 0 0 1px 0 !important; }
.table-hover tbody tr:hover { background: #f6faf9; }
.table tfoot { display: none; }
.table .actions { white-space: nowrap; width: 1%; }
.cell-media { display: flex; align-items: center; gap: .7rem; min-width: 200px; }
.cell-media__title { font-weight: 600; line-height: 1.3; }
.cell-media__sub { font-size: .8rem; color: var(--c-text-faint); }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--c-surface-2); border: 1px solid var(--c-border); flex-shrink: 0; }
.thumb-lg { width: 72px; height: 72px; }
.thumb--empty { display: grid; place-items: center; color: var(--c-text-faint); font-size: 1rem; }

/* Mobile: stacked rows for tables marked .table-stack */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { border-bottom: 1px solid var(--c-border); padding: .5rem 0; }
  .table-stack td { border: 0 !important; padding: .3rem .9rem !important; display: flex; justify-content: space-between; gap: 1rem; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--c-text-faint); font-size: .8rem; font-weight: 500; }
  .table-stack td.actions { width: 100%; justify-content: flex-end; }
}

/* ---------- Badges / status ---------- */
.badge { font-weight: 600; font-size: .75rem; padding: .32em .65em; border-radius: 999px; }
.badge-success { background: var(--c-success-50); color: var(--c-success); }
.badge-warning { background: var(--c-warning-50); color: var(--c-warning); }
.badge-danger { background: var(--c-danger-50); color: var(--c-danger); }
.badge-info { background: var(--c-info-50); color: var(--c-info); }
.badge-primary { background: var(--c-primary-50); color: var(--c-primary); }
.badge-secondary, .badge-light { background: #eef1f4; color: var(--c-text-muted); }
.status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-inline-end: .35rem; vertical-align: middle; }

/* ---------- Alerts / toasts ---------- */
.alert { border: 1px solid transparent; border-radius: var(--radius); font-size: .9rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert .close { margin-inline-start: auto; order: 9; padding: 0 .25rem; float: none; }
.alert-success { background: var(--c-success-50); border-color: #cbe8d4; color: #14532d; }
.alert-danger { background: var(--c-danger-50); border-color: #f3caca; color: #7f1d1d; }
.alert-warning { background: var(--c-warning-50); border-color: #f4dcb7; color: #78350f; }
.alert-info { background: var(--c-info-50); border-color: #cbd8f7; color: #1e3a8a; }
.flash-stack { position: fixed; top: calc(var(--topbar-h) + 12px); left: 16px; z-index: 1080; width: min(380px, calc(100vw - 32px)); }
.flash-stack .alert { box-shadow: var(--shadow); }

/* ---------- Empty / loading ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--c-text-muted); }
.empty-state__icon { width: 56px; height: 56px; border-radius: 16px; display: inline-grid; place-items: center; background: var(--c-surface-2); color: var(--c-text-faint); font-size: 1.4rem; margin-bottom: .75rem; }
.empty-state__title { font-weight: 600; color: var(--c-text); margin-bottom: .25rem; }
.is-loading { position: relative; pointer-events: none; opacity: .65; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; display: inline-block; margin-inline-start: .5rem; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pagination ---------- */
.pagination { gap: .25rem; flex-wrap: wrap; margin: 0; }
.page-link { border-radius: var(--radius-sm) !important; border: 1px solid var(--c-border); color: var(--c-text); min-width: 36px; text-align: center; margin: 0 !important; }
.page-item.active .page-link { background: var(--c-primary); border-color: var(--c-primary); }
.page-link:hover { background: var(--c-surface-2); color: var(--c-primary); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.1rem; border-top: 1px solid var(--c-border); }
.pager__info { color: var(--c-text-muted); font-size: .84rem; }

/* ---------- Modals / dropdowns ---------- */
.modal-content { border: 0; border-radius: 14px; box-shadow: 0 20px 50px rgba(16, 35, 31, .2); }
.modal-header { border-bottom: 1px solid var(--c-border); }
.modal-header .close { margin: -1rem auto -1rem -1rem; }
.modal-footer { border-top: 1px solid var(--c-border); }
.modal-footer > * { margin: .25rem; }
.dropdown-menu { text-align: right; border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .4rem; font-size: .9rem; }
.dropdown-item { border-radius: 6px; padding: .5rem .75rem; display: flex; gap: .55rem; align-items: center; }
.dropdown-item i { width: 1rem; color: var(--c-text-faint); }
.dropdown-item:active { background: var(--c-primary); }

/* ---------- Image preview / uploads ---------- */
.upload-box { border: 1.5px dashed #c8d2d8; border-radius: var(--radius); padding: 1rem; background: var(--c-surface-2); text-align: center; }
.upload-box__preview { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: .75rem; }
.upload-box__preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 9px; border: 1px solid var(--c-border); background: #fff; }
.gallery { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.gallery__item { position: relative; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.gallery__item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; }
.gallery__item .gallery__actions { position: absolute; top: 6px; left: 6px; }
.lightbox-img { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 8px; }

/* ---------- Chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: .5rem; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars__bar { width: 100%; max-width: 34px; background: var(--c-primary); border-radius: 5px 5px 2px 2px; min-height: 2px; opacity: .9; }
.bars__bar.is-zero { background: var(--c-border); }
.bars__col:hover .bars__bar { opacity: 1; background: var(--c-primary-600); }
.bars__label { font-size: .68rem; color: var(--c-text-faint); margin-top: .35rem; white-space: nowrap; }
.chart-legend { display: flex; justify-content: space-between; color: var(--c-text-muted); font-size: .82rem; margin-top: .5rem; }
.meter { height: 8px; background: var(--c-surface-2); border-radius: 4px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--c-primary); border-radius: 4px; }

/* ---------- Legacy SB Admin cleanup ---------- */
#wrapper #content-wrapper { background: transparent; }
.sticky-footer, .scroll-to-top { display: none !important; }
.text-gray-800 { color: var(--c-text) !important; }
.text-gray-600, .text-gray-500, .text-gray-400 { color: var(--c-text-muted) !important; }
.dataTables_wrapper .dataTables_filter { text-align: left !important; }
.dataTables_wrapper .dataTables_filter input { margin-right: .5rem; margin-left: 0; }
.dataTables_wrapper .dataTables_paginate { text-align: left !important; }

/* ---------- RTL fixes for Bootstrap 4 utilities ---------- */
.mr-auto { margin-left: auto !important; margin-right: 0 !important; }
.ml-auto { margin-right: auto !important; margin-left: 0 !important; }
.mr-1 { margin-left: .25rem !important; margin-right: 0 !important; } .ml-1 { margin-right: .25rem !important; margin-left: 0 !important; }
.mr-2 { margin-left: .5rem !important; margin-right: 0 !important; } .ml-2 { margin-right: .5rem !important; margin-left: 0 !important; }
.mr-3 { margin-left: 1rem !important; margin-right: 0 !important; } .ml-3 { margin-right: 1rem !important; margin-left: 0 !important; }
.pr-2 { padding-left: .5rem !important; padding-right: 0 !important; } .pl-2 { padding-right: .5rem !important; padding-left: 0 !important; }
.text-left { text-align: right !important; } .text-right { text-align: left !important; }
.float-left { float: right !important; } .float-right { float: left !important; }
.dropdown-menu-right { right: auto !important; left: 0 !important; }
.custom-control { padding-left: 0; padding-right: 1.5rem; }
.custom-control-label::before, .custom-control-label::after { left: auto; right: -1.5rem; }
.custom-switch { padding-right: 2.25rem; padding-left: 0; }
.custom-switch .custom-control-label::before { right: -2.25rem; left: auto; }
.custom-switch .custom-control-label::after { right: calc(-2.25rem + 2px); left: auto; }
.custom-switch .custom-control-input:checked ~ .custom-control-label::after { transform: translateX(-.75rem); }
.custom-control-input:checked ~ .custom-control-label::before { background: var(--c-primary); border-color: var(--c-primary); }
.form-check { padding-left: 0; padding-right: 1.25rem; }
.form-check-input { margin-left: 0; margin-right: -1.25rem; }
.close { float: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Push notification preview ---- */
.push-preview__phone { background: linear-gradient(160deg, #1f2a44, #3b4a6b); border-radius: 22px; padding: 2.2rem .9rem 3rem; max-width: 340px; margin: 0 auto; }
.push-preview__card { background: rgba(255, 255, 255, .94); border-radius: 14px; padding: .7rem .85rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); color: #111827; }
.push-preview__app { display: flex; align-items: center; gap: .4rem; font-size: .74rem; color: #4b5563; margin-bottom: .3rem; }
.push-preview__icon { width: 18px; height: 18px; border-radius: 5px; background: var(--c-primary, #2563eb); color: #fff; display: grid; place-items: center; font-size: .6rem; }
.push-preview__time { margin-inline-start: auto; }
.push-preview__title { font-weight: 700; font-size: .9rem; min-height: 1.2em; overflow-wrap: anywhere; }
.push-preview__body { font-size: .84rem; color: #374151; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.push-preview__title:empty::before { content: "عنوان الإشعار"; color: #9ca3af; font-weight: 400; }
.push-preview__body:empty::before { content: "نص الإشعار يظهر هنا"; color: #9ca3af; }
.char-count { font-size: .75rem; color: var(--c-text-faint); float: left; }
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0; }
.dl-grid dt { color: var(--c-text-muted); font-weight: 500; }
.dl-grid dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; } .dl-grid dd { margin-bottom: .4rem; } }
