﻿:root {
  --sidebar-width: 280px;
  --sidebar-mini-width: 84px;
  --admin-bg: #f5f7fb;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f8fafc;
  --admin-border: #dbe4ef;
  --admin-text: #1f2937;
  --admin-muted: #6b7280;
  --admin-primary: #2563eb;
  --admin-primary-dark: #1d4ed8;
  --admin-success: #0f766e;
  --admin-warning: #d97706;
  --admin-danger: #dc2626;
  --admin-sidebar: #111827;
  --admin-sidebar-soft: #1f2937;
  --admin-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
  --admin-shadow: 0 18px 46px rgba(15, 23, 42, 0.09);
  --admin-shadow-lg: 0 26px 70px rgba(15, 23, 42, 0.12);
  --admin-ring: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(180deg, #f8fbff 0%, var(--admin-bg) 42%, #eef4fa 100%);
    color: var(--admin-text);
    font-family: "Segoe UI", Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

a {
  text-decoration: none;
}

.admin-shell {
    min-height: 100vh;
    direction: rtl;    /*//اضافة*/
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  /* Reserve scrollbar gutter to keep inner content width stable so header/footer dividers align with scrollbar */
  scrollbar-gutter: stable;
  background: var(--admin-sidebar);
  color: #ffffff;
  box-shadow: 18px 0 42px rgba(15, 23, 42, 0.18);
  transform: translateX(0);
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-header {
  padding: 1.35rem 1.25rem 1.15rem;
  margin-inline: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: #ffffff;
}

.brand-mark:hover,
.brand-mark:focus {
  color: #ffffff;
}

.brand-icon,
.profile-avatar,
.metric-icon,
.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 800;
}
.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #ffffff;
    color: #1e3a5f;
}
/*.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: #ffffff;
}*/

.brand-copy,
.brand-title,
.brand-subtitle,
.nav-text,
.sidebar-footer-text {
  min-width: 0;
  transition: opacity 0.16s ease, width 0.16s ease;
}

.brand-title,
.brand-subtitle {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}

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

.brand-subtitle {
  color: #9ca3af;
  font-size: 0.78rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem 1rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.78rem 0.9rem;
  border-radius: 8px;
  color: #d1d5db;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link.active {
  background: var(--admin-sidebar-soft);
  color: #ffffff;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus {
  transform: translateX(2px);
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #bfdbfe;
  font-size: 0.76rem;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: auto;
  margin-inline: 1.25rem;
  padding: 1rem 0;
  color: #d1d5db;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  white-space: nowrap;
}

.sidebar-user {
  margin: auto 1rem 1rem;
  padding: 0.85rem;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  border: 1px solid var(--admin-sidebar-border);
  border-radius: 8px;
  background: var(--admin-sidebar-soft);
  text-align: center;
}

.sidebar-user-avatar {
  border: 3px solid #53e9b9;
}

.sidebar-user strong {
  color: var(--admin-sidebar-text-strong);
  font-size: 1rem;
  line-height: 1.1;
}

.sidebar-user small {
  color: var(--admin-sidebar-muted);
  font-size: 0.84rem;
}

.status-dot,
.notification-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-dot {
  flex: 0 0 auto;
  background: #22c55e;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  display: none;
  background: rgba(15, 23, 42, 0.5);
}

.admin-main {
  width: auto;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
}

.admin-navbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: 72px;
  border-bottom: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
}

.admin-navbar.bg-white {
  background-color: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(14px);
}

.sidebar-toggle {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: var(--admin-ring);
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  display: block;
  background: var(--admin-text);
  border-radius: 999px;
}

.search-input {
  max-width: 520px;
  border-color: var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface-soft);
  min-height: 42px;
  box-shadow: none;
}

.search-input:focus {
  border-color: #93c5fd;
  box-shadow: var(--admin-ring);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-button,
.profile-button {
  border: 1px solid var(--admin-border);
  background: #ffffff;
  color: var(--admin-text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.icon-button:hover,
.icon-button:focus,
.profile-button:hover,
.profile-button:focus {
  border-color: #bfdbfe;
  box-shadow: var(--admin-ring);
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--admin-danger);
}

.notification-menu {
  width: min(320px, calc(100vw - 2rem));
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
}

.notification-menu .dropdown-item {
  display: grid;
  gap: 0.2rem;
  padding-block: 0.7rem;
}

.notification-title {
  font-weight: 700;
}

.notification-time {
  color: var(--admin-muted);
  font-size: 0.82rem;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-weight: 700;
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e0ecff;
  color: var(--admin-primary-dark);
  font-size: 0.76rem;
}

.avatar-img {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.avatar-md {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.avatar-xl {
  width: 78px;
  height: 78px;
  border-radius: 50%;
}

.profile-button .avatar-sm {
  border: 2px solid #52e7b8;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .profile-button .avatar-sm {
  border-color: #54f0be;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.dashboard-content {
  min-height: calc(100vh - 132px);
}

.dashboard-content > .container-fluid {
  padding-top: 1.75rem !important;
  padding-bottom: 1.75rem !important;
}

.page-heading,
.panel-header,
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading {
  margin-bottom: 1.35rem;
}

.page-heading h1 {
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--admin-primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--admin-primary-dark);
  background: var(--admin-primary-dark);
}

.metric-card,
.panel {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow);
}

.metric-card {
  position: relative;
  min-height: 164px;
  padding: 1.35rem;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-color, var(--admin-primary));
}

.metric-card:hover {
  border-color: #c6d5e8;
  box-shadow: var(--admin-shadow-lg);
  transform: translateY(-3px);
}

.metric-primary {
  --metric-color: var(--admin-primary);
}

.metric-success {
  --metric-color: var(--admin-success);
}

.metric-warning {
  --metric-color: var(--admin-warning);
}

.metric-danger {
  --metric-color: var(--admin-danger);
}

.metric-label {
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--metric-color, var(--admin-primary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.metric-success .metric-icon {
  background: #e7f6f3;
}

.metric-warning .metric-icon {
  background: #fff4df;
}

.metric-danger .metric-icon {
  background: #ffecec;
}

.metric-value {
  margin-top: 1rem;
  color: var(--admin-text);
  font-size: 2.18rem;
  font-weight: 800;
  line-height: 1;
}

.metric-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.9rem;
  color: var(--admin-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.panel {
  padding: 1.35rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.panel:hover {
  border-color: #c6d5e8;
  box-shadow: var(--admin-shadow-lg);
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-header p {
  font-size: 0.92rem;
}

.chart-bars {
  height: 292px;
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  align-items: end;
  gap: 1rem;
  padding: 1.2rem 0.4rem 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.chart-column {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 0.6rem;
  color: var(--admin-muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.chart-column span {
  width: 100%;
  height: var(--bar-size);
  min-height: 28px;
  display: block;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--admin-primary), var(--admin-success));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.bar-42 {
  --bar-size: 42%;
}

.bar-58 {
  --bar-size: 58%;
}

.bar-51 {
  --bar-size: 51%;
}

.bar-72 {
  --bar-size: 72%;
}

.bar-66 {
  --bar-size: 66%;
}

.bar-83 {
  --bar-size: 83%;
}

.activity-list {
  display: grid;
  gap: 1.1rem;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--admin-border);
}

.activity-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.activity-dot {
  width: 12px;
  height: 12px;
  margin-top: 0.45rem;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.08);
}

.table {
  --bs-table-bg: transparent;
}

.table thead th {
  color: var(--admin-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td {
  min-width: 120px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.table tbody tr {
  transition: background 0.16s ease;
}

.table tbody tr:hover {
  background: #f8fbff;
}

.badge {
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}

.table-search {
  width: min(260px, 100%);
  border-color: var(--admin-border);
  border-radius: 8px;
}

.table-media {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.product-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--admin-border);
}

.profile-avatar-lg {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  font-size: 1.5rem;
}

.profile-hero {
  display: grid;
  justify-items: center;
}

.profile-card {
  overflow: hidden;
}

.profile-cover {
  margin: -1.35rem -1.35rem 0.9rem;
  height: 96px;
  border-bottom: 1px solid var(--admin-border);
}

.profile-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.profile-photo {
  margin-top: -44px;
  border: 4px solid var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
}

.info-list,
.settings-list,
.legend-list {
  display: grid;
  gap: 0.85rem;
}

.info-list div,
.mini-card,
.settings-row,
.legend-list div {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface-soft);
}

.info-list div,
.legend-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
}

.info-list span,
.mini-card span,
.settings-row small {
  color: var(--admin-muted);
  font-size: 0.84rem;
}

.info-list strong,
.mini-card strong {
  text-align: right;
}

.mini-card {
  display: grid;
  gap: 0.35rem;
  min-height: 104px;
  align-content: center;
  padding: 1rem;
}

.mini-card strong {
  color: var(--admin-text);
  font-size: 1.05rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
}

.settings-row span {
  display: grid;
  gap: 0.2rem;
}

.donut-chart {
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--admin-primary) 0 42%, var(--admin-success) 42% 68%, var(--admin-warning) 68% 86%, var(--admin-danger) 86% 100%);
  box-shadow: var(--admin-shadow-sm);
}

.donut-chart span {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--admin-text);
  font-size: 1.65rem;
  font-weight: 800;
}

.legend-list div {
  padding: 0.75rem 0.85rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.legend-list strong {
  margin-left: auto;
}

.progress {
  height: 1.15rem;
  border-radius: 8px;
  background: #e8eef6;
}

.progress-bar {
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.progress-42 {
  width: 42%;
}

.progress-58 {
  width: 58%;
}

.progress-72 {
  width: 72%;
}

.blank-panel {
  min-height: 440px;
  display: grid;
  place-items: center;
  text-align: center;
}

.blank-state {
  max-width: 440px;
  display: grid;
  justify-items: center;
}

.blank-visual {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 0.9rem;
}

.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fbff 0%, #eaf2ff 44%, #eef8f6 100%);
}

.auth-page,
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card,
.error-card {
  width: min(100%, 460px);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--admin-shadow-lg);
}

.auth-card {
  padding: 1.5rem;
}

.auth-visual {
  margin-bottom: 1rem;
  height: 96px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
}

.auth-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.error-card {
  padding: 2rem;
  text-align: center;
}

.error-illustration {
  width: min(260px, 100%);
  max-height: 132px;
  object-fit: contain;
  margin: 0 auto 0.55rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--admin-text);
}

.auth-brand:hover,
.auth-brand:focus {
  color: var(--admin-text);
}

.auth-brand span:last-child {
  display: grid;
  line-height: 1.2;
}

.auth-brand small,
.auth-footer {
  color: var(--admin-muted);
}

.auth-footer {
  margin-top: 1.2rem;
  text-align: center;
  font-size: 0.92rem;
}

.error-code {
  color: var(--admin-primary);
  font-size: clamp(5rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
}

.admin-footer {
  padding: 1.1rem 0 1.35rem;
  color: var(--admin-muted);
  font-size: 0.9rem;
}

.admin-footer .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 992px) {
  body.sidebar-mini .admin-sidebar {
    width: var(--sidebar-mini-width);
  }

  body.sidebar-mini .admin-main {
    margin-left: var(--sidebar-mini-width);
  }

  body.sidebar-mini .brand-copy,
  body.sidebar-mini .nav-text,
  body.sidebar-mini .sidebar-footer-text {
    width: 0;
    opacity: 0;
    overflow: hidden;
  }

  body.sidebar-mini .sidebar-header,
  body.sidebar-mini .sidebar-footer {
    margin-inline: 1rem;
    padding-inline: 0;
  }

  body.sidebar-mini .sidebar-nav .nav-link {
    justify-content: center;
    padding-inline: 0.65rem;
  }

  body.sidebar-mini .sidebar-nav .nav-link:hover,
  body.sidebar-mini .sidebar-nav .nav-link:focus {
    transform: none;
  }
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    width: min(var(--sidebar-width), calc(100vw - 48px));
    transform: translateX(-100%);
  }

  .admin-main {
    margin-left: 0;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
}

@media (max-width: 575.98px) {
  .page-heading,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    width: 100%;
    justify-content: stretch;
  }

  .heading-actions .btn {
    flex: 1 1 0;
  }

  .chart-bars {
    height: 220px;
    gap: 0.6rem;
    padding-inline: 0.25rem;
  }

  .metric-value {
    font-size: 1.85rem;
  }

  .metric-card,
  .panel {
    padding: 1.1rem;
  }

  .admin-footer .container-fluid {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-nav .nav-link,
  .sidebar-toggle,
  .icon-button,
  .profile-button,
  .btn,
  .metric-card,
  .panel,
  .table tbody tr {
    transition: none;
  }

  .sidebar-nav .nav-link:hover,
  .sidebar-nav .nav-link:focus,
  .btn:hover,
  .btn:focus,
  .metric-card:hover {
    transform: none;
  }
}

html[data-theme="dark"] {
  --admin-bg: #0f172a;
  --admin-surface: #182235;
  --admin-surface-soft: #111827;
  --admin-border: #2f3b52;
  --admin-text: #e5edf7;
  --admin-muted: #9aa8bd;
  --admin-primary: #60a5fa;
  --admin-primary-dark: #3b82f6;
  --admin-success: #2dd4bf;
  --admin-warning: #fbbf24;
  --admin-danger: #f87171;
  --admin-sidebar: #090f1d;
  --admin-sidebar-soft: #172033;
  --admin-shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.24);
  --admin-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  --admin-shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.42);
  --admin-ring: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #111827 0%, var(--admin-bg) 48%, #0b1120 100%);
}

.brand-icon {
  font-size: 1.1rem;
}

.nav-icon {
  font-size: 0.95rem;
}

.theme-toggle i {
  font-size: 1rem;
}

.admin-navbar.bg-white,
.sidebar-toggle,
.icon-button,
.profile-button {
  background-color: var(--admin-surface) !important;
  color: var(--admin-text);
}

html[data-theme="dark"] .admin-navbar.bg-white {
  background-color: rgba(24, 34, 53, 0.92) !important;
}

html[data-theme="dark"] .profile-avatar {
  background: #1e3a5f;
  color: #bfdbfe;
}

.page-heading-copy {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  min-width: 0;
}

.page-icon,
.section-title i {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--admin-primary-dark);
}

.page-icon {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.section-title i {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
}

html[data-theme="dark"] .page-icon,
html[data-theme="dark"] .section-title i {
  background: #1e3a5f;
  color: #bfdbfe;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-light {
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-text);
}

.btn-outline-secondary {
  border-color: var(--admin-border);
  color: var(--admin-text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: var(--admin-primary);
  background: #eaf2ff;
  color: var(--admin-primary-dark);
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-secondary:focus {
  background: #1e3a5f;
  color: #bfdbfe;
}

html[data-theme="dark"] .chart-bars {
  background: linear-gradient(180deg, #111827 0%, #182235 100%);
}

html[data-theme="dark"] .table tbody tr:hover {
  background: #111827;
}

html[data-theme="dark"] .progress {
  background: #243149;
}

html[data-theme="dark"] .auth-body {
  background: linear-gradient(135deg, #0b1120 0%, #111827 48%, #10201f 100%);
}

.auth-card,
.error-card {
  background: var(--admin-surface);
}

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.dropdown-menu,
.modal-content,
.accordion-item,
.accordion-button {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
}

.dropdown-item,
.accordion-body {
  color: var(--admin-text);
}

.dropdown-item:hover,
.dropdown-item:focus,
.accordion-button:not(.collapsed) {
  background-color: var(--admin-surface-soft);
  color: var(--admin-text);
}

.form-control,
.form-select {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
}

.form-control:focus,
.form-select:focus {
  border-color: #93c5fd;
  background-color: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--admin-ring);
}

.form-control::placeholder {
  color: var(--admin-muted);
}

.text-muted {
  color: var(--admin-muted) !important;
}

html[data-theme="dark"] .text-body {
  color: var(--admin-text) !important;
}

html[data-theme="dark"] .text-bg-secondary {
  background-color: #334155 !important;
  color: #e5edf7 !important;
}

@media (max-width: 767.98px) {
  .navbar-actions {
    gap: 0.5rem;
  }

  .icon-button,
  .profile-button,
  .sidebar-toggle {
    width: 40px;
    height: 40px;
  }

  .profile-button {
    padding: 0.3rem;
  }

  .page-heading-copy {
    align-items: flex-start;
  }
}

@media (max-width: 575.98px) {
  .page-heading-copy {
    width: 100%;
  }

  .page-icon {
    width: 44px;
    height: 44px;
  }

  .panel-header .d-flex,
  .panel-header .form-control,
  .panel-header .form-select {
    width: 100%;
  }
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body,
.admin-navbar,
.admin-sidebar,
.admin-main,
.metric-card,
.panel,
.auth-card,
.error-card,
.dropdown-menu,
.modal-content,
.form-control,
.form-select {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.table {
  --bs-table-color: var(--admin-text);
  --bs-table-border-color: var(--admin-border);
  color: var(--admin-text);
}

.page-link {
  border-color: var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
}

.page-link:hover,
.page-link:focus {
  border-color: var(--admin-primary);
  background: var(--admin-surface-soft);
  color: var(--admin-primary);
}

.page-item.active .page-link {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
  color: #ffffff;
}

.page-item.disabled .page-link {
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
}

.alert {
  border-radius: 8px;
}

html[data-theme="dark"] .alert-primary {
  border-color: #1d4ed8;
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
}

html[data-theme="dark"] .alert-success {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.18);
  color: #99f6e4;
}

html[data-theme="dark"] .alert-warning {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.18);
  color: #fde68a;
}

html[data-theme="dark"] .alert-danger {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.16);
  color: #fecaca;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .accordion-item {
  border-color: var(--admin-border);
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

html[data-theme="dark"] .text-bg-info {
  background-color: #0e7490 !important;
  color: #ecfeff !important;
}

html[data-theme="dark"] .text-bg-warning {
  background-color: #b45309 !important;
  color: #fff7ed !important;
}

html[data-theme="dark"] .text-bg-success {
  background-color: #0f766e !important;
  color: #ecfdf5 !important;
}

html[data-theme="dark"] .text-bg-danger {
  background-color: #b91c1c !important;
  color: #fef2f2 !important;
}

@media (max-width: 991.98px) {
  .dashboard-content > .container-fluid {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  .admin-sidebar {
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.28);
  }
}

@media (max-width: 767.98px) {
  .panel-header {
    align-items: flex-start;
  }

  .panel-header > .d-flex {
    width: 100%;
  }

  .table-search {
    width: 100%;
  }

  .auth-page,
  .error-page {
    padding: 1rem;
  }

  .auth-card,
  .error-card {
    padding: 1.15rem;
  }
}

@media (max-width: 420px) {
  .heading-actions {
    width: 100%;
  }

  .heading-actions .btn {
    width: 100%;
  }

  .metric-card {
    min-height: 146px;
  }

  .profile-avatar-lg {
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 575.98px) {
  .avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .avatar-xl {
    width: 70px;
    height: 70px;
  }

  .profile-cover {
    height: 82px;
    margin-bottom: 0.75rem;
  }

  .profile-photo {
    margin-top: -38px;
  }

  .auth-visual {
    height: 82px;
  }

  .product-thumb {
    width: 36px;
    height: 36px;
  }
}

html:not([data-theme="dark"]) {
  --admin-sidebar: #ffffff;
  --admin-sidebar-soft: #eef4ff;
  --admin-sidebar-border: #dbe4ef;
  --admin-sidebar-text: #475569;
  --admin-sidebar-text-strong: #0f172a;
  --admin-sidebar-muted: #64748b;
  --admin-sidebar-icon-bg: #eaf2ff;
  --admin-sidebar-icon: #2563eb;
  --admin-sidebar-shadow: 18px 0 42px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
  --admin-sidebar-border: rgba(255, 255, 255, 0.08);
  --admin-sidebar-text: #d1d5db;
  --admin-sidebar-text-strong: #ffffff;
  --admin-sidebar-muted: #9ca3af;
  --admin-sidebar-icon-bg: rgba(255, 255, 255, 0.08);
  --admin-sidebar-icon: #bfdbfe;
  --admin-sidebar-shadow: 18px 0 42px rgba(0, 0, 0, 0.34);
}

.admin-sidebar {
  border-right: 1px solid var(--admin-sidebar-border);
  background: var(--admin-sidebar);
  color: var(--admin-sidebar-text-strong);
  box-shadow: var(--admin-sidebar-shadow);
}

.sidebar-header {
  border-bottom-color: var(--admin-sidebar-border);
}

.brand-mark,
.brand-mark:hover,
.brand-mark:focus {
  color: var(--admin-sidebar-text-strong);
}

.brand-subtitle {
  color: var(--admin-sidebar-muted);
}

.sidebar-nav .nav-link {
  color: var(--admin-sidebar-text);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link.active {
  background: var(--admin-sidebar-soft);
  color: var(--admin-sidebar-text-strong);
}

.nav-icon {
  background: var(--admin-sidebar-icon-bg);
  color: var(--admin-sidebar-icon);
}

.sidebar-footer {
  border-top-color: var(--admin-sidebar-border);
  color: var(--admin-sidebar-text);
}









.top-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #111827;
    font-weight: 600;
    transition: 0.2s;
}

    .top-nav-btn:hover {
        background: #eef2ff;
        color: #0f172a;
        border-color: #cbd5e1;
    }

    .top-nav-btn i {
        font-size: 1rem;
    }
.top-nav-btn.active {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.brand-icon {
    background: #ffffff !important;
    color: #1e3a5f !important;
    border: 1px solid #e5e7eb;
}
/*.sidebar-nav .nav-link.active,
.nav-link.active {
    background: #16a34a;
    color: #fff !important;
    border-radius: 12px;
}

    .sidebar-nav .nav-link.active .nav-icon,
    .sidebar-nav .nav-link.active .nav-text,
    .nav-link.active .nav-icon,
    .nav-link.active .nav-text {
        color: #fff !important;
    }*/
/*تعديل الداش بورد مكانها 
*/



/* =========================
   RTL admin layout patch
   ========================= */

/*html, body {
  direction: rtl;
  text-align: right;
}

.admin-shell {
  min-height: 100vh;
  direction: rtl;
}*/

/* السايدبار: بدل اليسار -> اليمين */
/*.admin-sidebar {
  inset: 0 auto 0 0;*/ /* الأصل */
  /*inset: 0 0 0 auto !important;*/ /* يمين */
  /*box-shadow: -18px 0 42px rgba(15, 23, 42, 0.18);
}*/

/* المحتوى الرئيسي: خذ مساحة الصفحة مع ترك مكان للسايدبار من اليمين */
/*.dashboard-content {
  min-height: calc(100vh - 132px);
  margin-right: var(--sidebar-width);
  margin-left: 0 !important;
  width: calc(100% - var(--sidebar-width));
}*/

/* لو عندك هيدر علوي ثابت/ملتصق داخل القالب */
/*.admin-header,
.topbar,
.dashboard-header {
  margin-right: var(--sidebar-width);
  margin-left: 0 !important;
  width: calc(100% - var(--sidebar-width));
  right: 0;
  left: auto !important;
}*/

/* محاذاة عناصر القائمة للعربي */
/*.sidebar-nav .nav-link {
  text-align: right;
}

.sidebar-nav .nav-link .nav-icon {
  margin-left: 10px;
  margin-right: 0;
}*/

/* الشاشات الصغيرة: لا نترك فراغ للسايدبار */
/*@media (max-width: 991.98px) {
  .dashboard-content,
  .admin-header,
  .topbar,
  .dashboard-header {
    margin-right: 0;
    width: 100%;
  }

  .admin-sidebar {
    inset: 0 0 0 auto !important;
    transform: translateX(100%);*/ /* مخفي خارج اليمين */
  /*}

  .admin-sidebar.is-open,
  .admin-shell.sidebar-open .admin-sidebar,
  .admin-sidebar.show {
    transform: translateX(0);
  }
}*/




/* ===== Variables ===== */
:root {
    /*   --primary: #1e3a5f;
    --primary-light: #2563eb;
    --primary-gradient: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    --accent: #f59e0b;
    --accent-light: #fef3c7;

*/
    --primary: #6b21a8;
    --primary-light: #9333ea;
    --primary-gradient: linear-gradient(135deg, #6b21a8 0%, #9333ea 100%);
    --accent: #ec4899;
    --accent-light: #fce7f3;


/*                      اللون البنفسجي            */
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    direction: rtl;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .3s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
}

.logo-main {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.logo-sub {
    color: rgba(255,255,255,.6);
    font-size: 18px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

    .sidebar-nav::-webkit-scrollbar {
        width: 4px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,.2);
        border-radius: 4px;
    }

.nav-section-label {
    color: rgba(255,255,255,.4);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .2s;
    position: relative;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
}

    .nav-item:hover {
        background: rgba(255,255,255,.1);
        color: #fff;
    }

    .nav-item.active {
        background: rgba(255,255,255,.15);
        color: #fff;
        border-right: 3px solid var(--accent);
    }

    .nav-item i {
        width: 18px;
        text-align: center;
        font-size: 14px;
    }

.badge {
    margin-right: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name-sm {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-num-sm {
    color: rgba(255,255,255,.5);
    font-size: 10px;
}

.logout-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(239,68,68,.2);
    color: #fca5a5;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all .2s;
    flex-shrink: 0;
}

    .logout-btn:hover {
        background: rgba(239,68,68,.4);
        color: #fff;
    }

/* ===== Main Wrapper ===== */
.main-wrapper {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin .3s ease;
}

/* ===== Topbar ===== */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.topbar-actions {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notif-btn {
    position: relative;
    background: var(--gray-100);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-600);
    transition: all .2s;
}

    .notif-btn:hover {
        background: var(--info-light);
        color: var(--info);
    }

.notif-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: 700;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    padding: 6px 12px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
}

.user-avatar-chip {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.role-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
}

    .role-tag.hr {
        background: var(--accent-light);
        color: #92400e;
    }

/* ===== Notifications ===== */
.notif-dropdown {
    position: fixed;
    top: 70px;
    left: 24px;
    width: 340px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    z-index: 999;
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}

.mark-read-btn {
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: 12px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}

.notif-item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background .15s;
}

    .notif-item:hover {
        background: var(--gray-50);
    }

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--info);
    margin-top: 5px;
    flex-shrink: 0;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
}

.notif-msg {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.notif-time {
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 4px;
}

.notif-empty {
    text-align: center;
    padding: 24px;
    color: var(--gray-400);
}

/* ===== Page Content ===== */
.page-content {
    flex: 1;
    padding: 24px;
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: transform .2s, box-shadow .2s;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 4px;
        height: 100%;
        background: var(--card-color, var(--primary));
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
    background: var(--card-light, var(--info-light));
    color: var(--card-color, var(--info));
}

.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.stat-change {
    font-size: 11px;
    margin-top: 6px;
}

    .stat-change.up {
        color: var(--success);
    }

    .stat-change.down {
        color: var(--danger);
    }

/* ===== Cards ===== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

    .card-title i {
        color: var(--primary-light);
    }

.card-body {
    padding: 20px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* ===== Tables ===== */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    padding: 11px 14px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 2px solid var(--gray-200);
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

tr:hover td {
    background: var(--gray-50);
}

tr:last-child td {
    border-bottom: none;
}

/* ===== Badges / Status ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

    .status-badge::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

    .badge-success::before {
        background: var(--success);
    }

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

    .badge-danger::before {
        background: var(--danger);
    }

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

    .badge-warning::before {
        background: var(--warning);
    }

.badge-info {
    background: var(--info-light);
    color: #1e40af;
}

    .badge-info::before {
        background: var(--info);
    }

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

    .badge-gray::before {
        background: var(--gray-400);
    }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    border: none;
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
}

    .btn-primary:hover {
        opacity: .9;
        transform: translateY(-1px);
    }

.btn-success {
    background: var(--success);
    color: #fff;
}

    .btn-success:hover {
        background: #059669;
    }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

    .btn-danger:hover {
        background: #dc2626;
    }

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

    .btn-outline:hover {
        background: var(--gray-50);
    }

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Cairo', sans-serif;
    color: var(--gray-800);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    direction: rtl;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary-light);
        box-shadow: 0 0 0 3px rgba(147,51,234,.12);
        /* box-shadow: 0 0 0 3px rgba(37,99,235,.1) ;                          اللون الازرق */
    }

    .form-control::placeholder {
        color: var(--gray-400);
    }

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.form-hint {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

.form-error {
    font-size: 11px;
    color: var(--danger);
    margin-top: 4px;
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

    .modal-overlay.open {
        opacity: 1;
        pointer-events: all;
    }

.modal {
    background: #fff;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform .25s;
    box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

    .modal-close:hover {
        background: var(--gray-200);
    }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== Alerts ===== */
.alert-success, .alert-error {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

    .alert-success.show, .alert-error.show {
        display: flex;
    }

/* ===== Progress Bar ===== */
.progress-bar {
    background: var(--gray-200);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--primary-gradient);
    transition: width .6s ease;
}

    .progress-fill.success {
        background: var(--success);
    }

    .progress-fill.warning {
        background: var(--warning);
    }

    .progress-fill.danger {
        background: var(--danger);
    }

/* ===== Grid ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gap-16 {
    gap: 16px;
}

/* ===== Avatar ===== */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 28px;
}

/* ===== Auth Pages ===== */
.auth-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /*  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%);                                   اللو ن الازرق*/ 
    background: linear-gradient(135deg, #2e1065 0%, #6b21a8 50%, #9333ea 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

    .auth-bg::before {
        content: '';
        position: absolute;
        inset: 0;
        background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    }

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,.4);
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.auth-logo-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.auth-logo-sub {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.auth-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.auth-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 28px;
}

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}

.otp-input {
    width: 50px;
    height: 58px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    outline: none;
    transition: all .2s;
    font-family: 'Cairo', sans-serif;
}

    .otp-input:focus {
        border-color: var(--primary-light);
        box-shadow: 0 0 0 4px rgba(147,51,234,.15);
        /* box-shadow: 0 0 0 4px rgba(37,99,235,.15);     اللون الازرق*/
    }

.timer {
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
}

    .timer span {
        color: var(--primary-light);
        font-weight: 700;
    }

/* ===== Performance Colors ===== */
.perf-excellent {
    color: #059669;
}

.perf-good {
    color: #2563eb;
}

.perf-average {
    color: #d97706;
}

.perf-poor {
    color: #dc2626;
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: #fff;
    padding: 14px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 16px;
}

    .filter-bar .form-control {
        width: auto;
    }

.search-input {
    min-width: 240px;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-light);
    margin-top: 4px;
    flex-shrink: 0;
    position: relative;
}

    .timeline-dot::before {
        content: '';
        position: absolute;
        top: 12px;
        right: 5px;
        width: 2px;
        height: calc(100% + 8px);
        background: var(--gray-200);
    }

.timeline-item:last-child .timeline-dot::before {
    display: none;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 13px;
    font-weight: 600;
}

.timeline-date {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--gray-500);
    position: relative;
    font-family: 'Cairo', sans-serif;
    transition: color .2s;
}

    .tab-btn.active {
        color: var(--primary-light);
    }

        .tab-btn.active::after {
            content: '';
            position: absolute;
            bottom: -2px;
            right: 0;
            left: 0;
            height: 2px;
            background: var(--primary-light);
            border-radius: 2px 2px 0 0;
        }

.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }

/* ===== Upload Area ===== */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--gray-50);
}

    .upload-area:hover {
        border-color: var(--primary-light);
        background: var(--info-light);
    }

    .upload-area.dragover {
        border-color: var(--primary-light);
        background: var(--info-light);
    }

/* ===== Mobile First Responsive ===== */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        font-size: 13px;
    }

    /* Sidebar - slide from right */
    .sidebar {
        transform: translateX(110%);
        width: 280px !important;
        box-shadow: -8px 0 32px rgba(0,0,0,.3);
        z-index: 1100;
    }

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

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 1050;
    }

    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }

    /* Main wrapper */
    .main-wrapper {
        margin-right: 0 !important;
    }

    .menu-toggle {
        display: flex !important;
    }

    /* Topbar */
    .topbar {
        padding: 0 12px;
        height: 56px;
    }

    .page-title {
        font-size: 14px;
    }

    .user-chip span:not(.role-tag) {
        display: none;
    }

    .user-chip {
        padding: 4px 8px;
    }

    /* Page content */
    .page-content {
        padding: 12px;
    }

    /* Grids */
    .form-row, .form-row-3, .grid-2, .grid-3 {
        grid-template-columns: 1fr !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Cards */
    .card {
        border-radius: 10px;
    }

    .card-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-body {
        padding: 14px;
    }

    .card-title {
        font-size: 13px;
    }

    /* Tables - horizontal scroll */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 560px;
        font-size: 12px;
    }

    th, td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    /* Buttons */
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .btn-sm {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* Notifications */
    .notif-dropdown {
        position: fixed;
        top: 56px;
        left: 8px;
        right: 8px;
        width: auto !important;
        max-height: 70vh;
        overflow-y: auto;
        z-index: 999;
    }

    /* Stats cards - 2 per row on mobile */
    .stat-card {
        padding: 14px;
    }

    .stat-num {
        font-size: 24px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-bottom: 8px;
    }

    /* Auth pages */
    .auth-card {
        padding: 24px 20px;
        margin: 8px;
    }

    .auth-logo-icon {
        font-size: 36px;
    }

    .otp-input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }

    /* Modal */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-width: 100% !important;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        overflow-y: auto;
    }

    .modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
    }

    .modal-body {
        padding: 16px 20px;
    }

    .modal-footer {
        padding: 12px 20px;
        position: sticky;
        bottom: 0;
        background: #fff;
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
        gap: 8px !important;
        padding: 12px;
    }

        .filter-bar .form-control,
        .filter-bar .btn,
        .filter-bar .search-input {
            width: 100% !important;
        }

    /* Welcome banner */
    .welcome-banner-inner {
        flex-direction: column;
        gap: 12px;
    }

    /* Tab buttons */
    .tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .tab-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}
/*  الكود الخاص بالصفوف ال4 ف الشاشة الكبيرة وتعديلته ف الاجهزة الصغيرة */
@media (max-width: 992px) {
    .form-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .form-row-4 {
        grid-template-columns: 1fr;
    }
}
/* Small phones */
@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .otp-inputs {
        gap: 6px;
    }

    .otp-input {
        width: 38px;
        height: 46px;
        font-size: 18px;
    }

    .stat-num {
        font-size: 20px;
    }
}

/* Bottom Nav for Mobile */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid var(--gray-200);
        z-index: 1000;
        padding: 8px 0 env(safe-area-inset-bottom);
        box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-size: 10px;
        font-weight: 600;
        color: var(--gray-500);
        text-decoration: none;
        padding: 6px 4px;
        transition: color .2s;
    }

        .mobile-nav-item i {
            font-size: 18px;
        }

        .mobile-nav-item.active {
            color: var(--primary-light);
        }

            .mobile-nav-item.active i {
                color: var(--primary-light);
            }

    /* إضافة padding للمحتوى لتجنب التداخل مع الـ bottom nav */
    .page-content {
        padding-bottom: 80px !important;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* ===== Utilities ===== */
.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.mt-4 {
    margin-top: 4px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.mb-16 {
    margin-bottom: 16px;
}

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

.text-muted {
    color: var(--gray-500);
}

.text-sm {
    font-size: 12px;
}

.fw-bold {
    font-weight: 700;
}

.w-full {
    width: 100%;
}
/* ������� ������ ������� */
/* ������� �������� ������ */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px; /* ����� ��� ������ ����� ������ */
    width: 100%;
}

    /* ������ �� ��� ��� SVG ���� ������� */
    .logo-container svg {
        /* ����� ����� width � height ������ �� ����� ������ �� ������ ��� ����� */
        width: 60px;
        height: 80px;
        display: block;
    }

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    direction: ltr; /* ��� ����: ���� ������ ���� �� ������ ������ ������� */
}

.criterion {
    margin: 8px 0;
    color: #666;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

    .criterion.passed {
        color: #28a745; /* اللون الأخضر */
        font-weight: bold;
    }

        .criterion.passed i {
            content: "\f00c"; /* أيقونة check */
        }


.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
}

/* ===== Weekly Chart Bars (يُضاف في نهاية style.css) ===== */
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 180px;
    padding: 16px 8px 0;
}

.chart-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 8px;
}

    .chart-column span {
        display: block;
        width: 100%;
        max-width: 40px;
        background: var(--primary-gradient);
        border-radius: 6px 6px 0 0;
        transition: height .4s ease;
        min-height: 4px;
    }

    .chart-column small {
        font-size: 11px;
        color: var(--gray-500);
        white-space: nowrap;
    }

@media (max-width: 768px) {
    .chart-bars {
        height: 140px;
        gap: 6px;
    }

    .chart-column span {
        max-width: 26px;
    }
}

/* ===== Field Validation States (jQuery Unobtrusive) ===== */
.input-validation-error {
    border-color: var(--danger) !important;
}

    .input-validation-error:focus {
        box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important;
    }

.field-validation-error {
    color: var(--danger);
    font-size: 11px;
    margin-top: 4px;
    display: block;
}

.field-validation-valid {
    display: none;
}