/* لوحة التحكم - Bootstrap 5 */
:root {
  --sidebar-width: 280px;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

body.admin-auth{
  background:
    radial-gradient(900px 400px at 20% 20%, rgba(255,201,60,.16), transparent 60%),
    radial-gradient(900px 600px at 80% 30%, rgba(13,110,253,.20), transparent 60%),
    linear-gradient(180deg, rgba(10,22,40,.92), rgba(10,22,40,.86));
  background-attachment: fixed;
}

.admin-auth-wrap{
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.admin-auth .auth-card{
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
}

body.theme-dark.admin-auth .auth-card{
  background: rgba(30,30,45,.92);
  color: #fff;
}

.fw-black{font-weight:900}

/* الشريط الجانبي */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 100;
  padding: 48px 0 0;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  overflow-y: auto;
}

.sidebar .nav-link {
  font-weight: 500;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 4px 8px;
  transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
}

.sidebar .nav-link i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

/* المحتوى الرئيسي */
main {
  margin-right: var(--sidebar-width);
  min-height: calc(100vh - 60px);
}

/* البطاقات */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* الجداول */
.table {
  margin-bottom: 0;
}

.table thead th {
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* النماذج */
.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #495057;
}

.form-control,
.form-select {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* الأزرار */
.btn {
  border-radius: 8px;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

/* الإشعارات */
.alert {
  border-radius: 10px;
  border: none;
  padding: 1rem 1.5rem;
}

/* التجاوب */
@media (max-width: 991.98px) {
  .sidebar {
    width: 100%;
  }

  .sidebar {
    position: relative;
    top: 0;
    right: 0;
    margin-right: 0;
    padding: 1rem 0;
  }

  main {
    margin-right: 0;
  }
}

/* تحسينات إضافية */
.badge {
  padding: 0.5em 0.75em;
  border-radius: 6px;
  font-weight: 600;
}

.dropdown-menu {
  border-radius: 10px;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* تحسينات Summernote */
.note-editor.note-frame {
  border-radius: 10px;
  border: 1px solid #dee2e6;
}

.note-editor.note-frame .note-toolbar {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 10px 10px 0 0;
}

.note-editor.note-frame .note-editable {
  min-height: 300px;
}

/* وضع الظلام */
body.theme-dark .card {
  background-color: #1e1e2d;
  color: #fff;
}

body.theme-dark .table {
  color: #fff;
}

body.theme-dark .table thead th {
  background-color: #2b2b40;
  border-color: #3b3b4f;
}

body.theme-dark .form-control,
body.theme-dark .form-select {
  background-color: #2b2b40;
  border-color: #3b3b4f;
  color: #fff;
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus {
  background-color: #2b2b40;
  border-color: #0d6efd;
  color: #fff;
}

body.theme-dark .sidebar {
  background-color: #1e1e2d !important;
}

body.theme-dark .navbar {
  background-color: #1e1e2d !important;
}

/* تأثيرات التحميل */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* شريط التمرير المخصص */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* تحسينات للجوال */
@media (max-width: 767.98px) {
  .card-body {
    padding: 1rem;
  }

  .table-responsive {
    margin: 0 -1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}
