/* ==============
  Light Theme Dashboard - Professional Light Mode
  =================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;900&display=swap');
@import url("https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700&display=swap");

/* ==============
  General - Light Mode
===================*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f0f2f8;
  font-family: "Poppins", sans-serif;
  color: #1e293b;
  font-size: 13px;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 10px 0;
  font-family: "Poppins", sans-serif;
  color: #0f172a;

}

/* ==============
  Topbar - Light
===================*/
.topbar {
  background: var(--header-bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 999;
  height: 70px; /* ADD THIS */
  display: flex; /* ADD THIS */
  align-items: stretch; /* ADD THIS */
}

  .topbar .topbar-left {
    background: #a98adf;
    text-align: center;
    height: 70px;
    width: 240px;
    min-width: 240px; /* ADD THIS */
    display: flex; /* ADD THIS */
    align-items: center; /* ADD THIS */
    justify-content: center; /* ADD THIS */
    position: relative;
    z-index: 1;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
    /* REMOVE float: left */
  }

    .topbar .topbar-left .logo {
      line-height: 70px;
      color: #ffffff;
      font-size: 18px;
      font-weight: 600;
      letter-spacing: 0.5px;
    }

  /* Navbar - flex so dropdowns don't affect flow */
  .topbar .navbar-custom {
    background: var(--header-bg);
    margin-left: 0; /* REMOVE old margin */
    flex: 1; /* ADD THIS - takes remaining space */
    height: 70px;
    padding: 0 20px;
    border-bottom: 1px solid #eef2f7;
    display: flex; /* ADD THIS */
    align-items: center; /* ADD THIS */
    justify-content: space-between; /* ADD THIS */
    position: relative; /* ADD THIS - dropdowns position relative to this */
  }

/* Navbar right items - flex row */
.navbar-custom .navbar-right {
  display: flex; /* ADD THIS */
  align-items: center; /* ADD THIS */
  margin: 0;
  padding: 0;
  list-style: none;
}

  /* Fix nav links - remove line-height trick, use flex instead */
  .navbar-custom .navbar-right .nav-link {
    color: #5a6e8a;
    font-size: 20px;
    padding: 0 16px;
    height: 70px;
    display: flex; /* ADD THIS */
    align-items: center; /* ADD THIS */
    transition: all 0.2s;
    /* REMOVE line-height: 70px */
  }

    .navbar-custom .navbar-right .nav-link:hover {
      color: var(--primary-dark);
      background: #f0f2f8;
    }

  /* Fix dropdowns - must be position:absolute so they don't push content */
  .navbar-custom .navbar-right .dropdown {
    position: relative; /* ADD THIS */
  }

  .navbar-custom .navbar-right .dropdown-menu {
    position: absolute; /* ADD THIS - critical fix */
    top: 70px; /* ADD THIS */
    right: 0; /* ADD THIS */
    left: auto; /* ADD THIS */
    z-index: 1050; /* ADD THIS */
  }

/* Menu left (hamburger button side) */
.navbar-custom .menu-left {
  display: flex; /* ADD THIS */
  align-items: center; /* ADD THIS */
  margin: 0;
  padding: 0;
  list-style: none;
  /* REMOVE float: left if present */
}

/* Button stays vertically centered */
.button-menu-mobile {
  border: none;
  color: var(--primary-dark);
  background: transparent;
  height: 70px;
  width: 60px;
  font-size: 24px;
  display: flex; /* ADD THIS */
  align-items: center; /* ADD THIS */
  justify-content: center; /* ADD THIS */
  transition: all 0.2s;
}

  .button-menu-mobile:hover {
    background: #f0f2f8;
    color: var(--primary-medium);
  }

 


/* ==============
  Sidebar - Light
===================*/
.side-menu {
  width: 240px;
  background: #ffffff;
  bottom: 0;
  margin-top: 0;
  padding-bottom: 30px;
  position: fixed;
  top: 70px;
  left: 0;
  z-index: 10;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03);
  border-right: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  overflow-x: visible;
}

#sidebar-menu ul,
#sidebar-menu li {
  list-style: none !important;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

#sidebar-menu > ul > li > a {
  color: #475569;
  display: block;
  padding: 13px 20px;
  font-size: 14px;
  transition: all 0.3s;
  border-radius: 8px;
  margin: 4px 12px;
  text-decoration: none;
  cursor: pointer;
}

  #sidebar-menu > ul > li > a:hover,
  #sidebar-menu > ul > li > a:focus {
    color: #2563eb;
    background: #eff6ff;
  }

  #sidebar-menu > ul > li > a.mm-active {
    color: #2563eb !important;
    background: #eff6ff;
  }

#sidebar-menu .menu-title {
  padding: 12px 20px !important;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #94a3b8;
}

/* ==============
  Submenu - Normal Mode (Expanded)
===================*/
#sidebar-menu .submenu {
  display: none;
  list-style: none;
  padding-left: 1rem;
}

#sidebar-menu .has-submenu.open > .submenu {
  display: block;
}

#sidebar-menu .submenu li a {
  padding: 8px 20px 8px 10px;
  color: #64748b;
  display: block;
  transition: all 0.3s;
  border-radius: 6px;
  margin: 2px 12px 2px 24px;
  text-decoration: none;
}

  #sidebar-menu .submenu li a:hover {
    background: #f1f5f9;
    color: #2563eb;
  }

/* Menu Arrow */
.menu-arrow {
  float: left;
  display: inline-block;
  transition: transform 0.3s ease;
}

#sidebar-menu .has-submenu.open > a .menu-arrow {
  transform: rotate(90deg);
}

[dir="rtl"] .menu-arrow {
  float: right;
}

/* ==============
  Content Page
===================*/
.content-page {
  margin-left: 240px;
  background: #f0f2f8;
  min-height: 100vh;
  transition: all 0.3s ease;
}

  .content-page .content {
    padding: 20px 25px 10px 25px;
    margin-top: 70px;
    margin-bottom: 60px;
  }

/* ==============
  Footer
===================*/
.footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  padding: 19px 30px;
  position: relative;
  left: 0;
  bottom: 0;
  text-align: center;
  font-size: 12px;
}

/* ==============
  Cards
===================*/
.card {
  border: none;
  margin-bottom: 30px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
}

  .card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  }

.card-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: 16px 16px 0 0 !important;
}

/* ==============
  Page Title Bar
===================*/
.page-title-box {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 16px;
  padding: 16px 24px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

  .page-title-box .page-title {
    font-size: 18px;
    margin: 0;
    line-height: 30px;
    color: #0f172a;
    font-weight: 600;
  }

/* ==============
  Navbar Title
===================*/
.navbar.bg-primary {
  background: #ffffff !important;
  border-radius: 16px;
  margin-bottom: 24px;
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

  .navbar.bg-primary .container-fluid h1 {
    color: #0f172a !important;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
  }

  .navbar.bg-primary .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    padding: 8px 24px;
    font-weight: 500;
    border-radius: 10px;
    color: #ffffff;
    transition: all 0.3s;
  }

    .navbar.bg-primary .btn-success:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

/* ==============
  Buttons
===================*/
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  border-radius: 10px;
  padding: 8px 20px;
  font-weight: 500;
  color: white;
  cursor: pointer;
}

.btn-secondary {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  cursor: pointer;
}

  .btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
  }

/* ==============
  Tables
===================*/
.table {
  background: #ffffff;
}

  .table > tbody > tr > td,
  .table > tfoot > tr > td,
  .table > thead > tr > td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
  }

  .table td,
  .table th {
    color: #1e293b;
    border-color: #e2e8f0 !important;
  }

  .table thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #0f172a;
  }

.table-hover tbody tr:hover {
  background: #f8fafc;
}

/* ==============
  Form Elements
===================*/
.form-control {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #1e293b;
  padding: 10px 14px;
}

  .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
  }

  .form-control::placeholder {
    color: #94a3b8;
  }

label {
  color: #475569;
  font-weight: 500;
}

/* ==============
  الجداول
===================*/
.table {
  background: #ffffff;
}

  .table thead th {
    background: #f8fafc;
    color: var(--primary-dark);
    font-weight: 600;
    border-bottom: 2px solid #eef2f7;
  }

  .table td, .table th {
    color: #475569;
    border-color: #eef2f7;
    vertical-align: middle;
  }

.table-hover tbody tr:hover {
  background: #f8fafc;
}

/* ==============
  النماذج (Modals)
===================*/
.modal-header {
  background: #a98adf;
  color: white;
  /*border-radius: 12px 12px 0 0;*/
  padding: 16px 20px;
}

  .modal-header .modal-title {
    color: white;
    font-weight: 600;
  }

  .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
  }

.modal-body {
  background: #ffffff;
  padding: 20px;
}

.modal-footer {
  background: #f8fafc;
  border-top: 1px solid #eef2f7;
  border-radius: 0 0 12px 12px;
}


/* ==============
  Dropdown
===================*/
.dropdown-menu {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.dropdown-item {
  background: #ffffff;
  color: #475569;
}

  .dropdown-item:hover {
    background: #f1f5f9;
    color: #2563eb;
  }

/* ==============
  Alerts
===================*/
.alert-danger {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #dc2626;
  border-radius: 10px;
}

/* ==============
  Stats Cards
===================*/
.stat-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  border: 1px solid #e2e8f0;
}

  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
  }

  .stat-card .stat-title {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .stat-card .stat-value {
    color: #0f172a;
    font-size: 28px;
    font-weight: 700;
    margin-top: 8px;
  }

  .stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
  }

.bg-soft-primary {
  background: #eff6ff;
  color: #2563eb;
}

.bg-soft-success {
  background: #ecfdf5;
  color: #10b981;
}

.bg-soft-warning {
  background: #fffbeb;
  color: #f59e0b;
}

.bg-soft-danger {
  background: #fef2f2;
  color: #ef4444;
}

/* ==============
  Sidebar Collapsed Mode
===================*/
body.sidebar-collapsed .side-menu {
  width: 70px !important;
}

body.sidebar-collapsed .content-page {
  margin-left: 70px !important;
}

body.sidebar-collapsed .topbar .topbar-left {
  width: 70px;
  min-width: 70px;
}

/* Hide text in collapsed mode */
body.sidebar-collapsed #sidebar-menu .menu-title,
body.sidebar-collapsed #sidebar-menu > ul > li > a span:not(.menu-arrow),
body.sidebar-collapsed .menu-arrow {
  display: none !important;
}

/* Center icons in collapsed mode */
body.sidebar-collapsed #sidebar-menu > ul > li > a {
  text-align: center !important;
  padding: 14px 0 !important;
  justify-content: center !important;
}

  body.sidebar-collapsed #sidebar-menu > ul > li > a i {
    font-size: 20px !important;
    margin: 0 !important;
  }

/* ==============
  Submenu in Collapsed Mode - Show on Hover Only
===================*/
body.sidebar-collapsed .side-menu .has-submenu {
  position: relative !important;
}

body.sidebar-collapsed .side-menu .submenu {
  display: none !important;
  position: absolute !important;
  left: 70px !important;
  top: 0 !important;
  width: 220px !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15) !important;
  padding: 10px 0 !important;
  z-index: 99999 !important;
  border: 1px solid #e2e8f0 !important;
}

body.sidebar-collapsed .side-menu .has-submenu:hover .submenu {
  display: block !important;
}

body.sidebar-collapsed .side-menu .submenu li {
  display: block !important;
}

  body.sidebar-collapsed .side-menu .submenu li a {
    display: block !important;
    padding: 8px 16px !important;
    color: #475569 !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    text-align: right !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

    body.sidebar-collapsed .side-menu .submenu li a:hover {
      background: #f1f5f9 !important;
      color: #2563eb !important;
      padding-right: 24px !important;
    }

/* Arrow indicator for collapsed mode */
body.sidebar-collapsed .side-menu .has-submenu > a::after {
  content: '▶';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  color: #2563eb;
}

body.sidebar-collapsed .side-menu .has-submenu:hover > a::after {
  opacity: 1;
}

/* ==============
  RTL Support
===================*/
[dir="rtl"] body {
  font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .side-menu {
  left: auto;
  right: 0;
  border-left: 1px solid #e2e8f0;
  border-right: none;
}

[dir="rtl"] .content-page {
  margin-left: 0;
  margin-right: 240px;
}

[dir="rtl"] .footer {
  left: 0;
  right: 0;
}

[dir="rtl"] .topbar .navbar-custom {
  margin-left: 0;
  margin-right: 240px;
}

[dir="rtl"] .topbar .topbar-left {
  float: right;
}

[dir="rtl"] #sidebar-menu .submenu li a {
  padding: 8px 45px 8px 20px;
}

[dir="rtl"] body.sidebar-collapsed .content-page {
  margin-right: 70px !important;
  margin-left: 0 !important;
}

[dir="rtl"] body.sidebar-collapsed .side-menu .submenu {
  left: auto !important;
  right: 70px !important;
}

[dir="rtl"] body.sidebar-collapsed .side-menu .has-submenu > a::after {
  content: '◀';
  right: auto;
  left: 8px;
}

/* ==============
  Login Page Styles
===================*/
.bg-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.limiter {
  width: 100%;
  margin: 0 auto;
}

.container-login100 {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.wrap-login100 {
  width: 390px;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  padding: 30px 55px 33px 55px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.login100-form-title {
  font-size: 30px;
  color: #0f172a;
  line-height: 1.2;
  text-align: center;
  display: block;
  font-weight: 700;
}

.wrap-input100 {
  width: 100%;
  position: relative;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 30px;
}

.input100 {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.2;
  display: block;
  width: 100%;
  height: 45px;
  background: transparent;
  padding: 0 5px;
  border: none;
  outline: none;
}

.container-login100-form-btn {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 13px;
}

.login100-form-btn {
  font-size: 15px;
  border: none;
  border-radius: 10px;
  color: #fff;
  line-height: 1.2;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  cursor: pointer;
  transition: all 0.3s;
}

  .login100-form-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
  }

/* ==============
  Responsive
===================*/
@media (max-width: 768px) {
  .topbar .topbar-left {
    width: 70px !important;
    min-width: 70px;
  }

  .topbar .navbar-custom {
    margin-left: 70px !important;
  }

  .content-page {
    margin-left: 0 !important;
  }

  .side-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  body.sidebar-collapsed .side-menu {
    transform: translateX(0);
    width: 240px !important;
  }

  [dir="rtl"] .topbar .navbar-custom {
    margin-right: 70px !important;
    margin-left: 0 !important;
  }

  [dir="rtl"] .side-menu {
    transform: translateX(100%);
  }

  [dir="rtl"] body.sidebar-collapsed .side-menu {
    transform: translateX(0);
  }

  .wrap-login100 {
    padding: 30px 25px 33px 25px;
  }
}

/* العربية - Cairo */
/*[dir="rtl"] * {
  font-family: 'Cairo', sans-serif !important;
  letter-spacing: 0 !important;
}*/

/* الإنجليزية - Poppins (الموجود أصلاً) */
/*[dir="ltr"] * {
  font-family: 'Poppins', sans-serif !important;
}*/
/* =============================
   Typography - Font per Language
=============================== */

/* العربية */
[dir="rtl"] body,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] p, [dir="rtl"] span, [dir="rtl"] a,
[dir="rtl"] td, [dir="rtl"] th, [dir="rtl"] label,
[dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea,
[dir="rtl"] button, [dir="rtl"] .btn,
[dir="rtl"] .form-control,
[dir="rtl"] .dropdown-item,
[dir="rtl"] .modal-title,
[dir="rtl"] .card,
[dir="rtl"] .nav-link {
  font-family: 'Cairo', sans-serif !important;
  letter-spacing: 0 !important;
}

/* الإنجليزية */
[dir="ltr"] body,
[dir="ltr"] h1, [dir="ltr"] h2, [dir="ltr"] h3,
[dir="ltr"] h4, [dir="ltr"] h5, [dir="ltr"] h6,
[dir="ltr"] p, [dir="ltr"] span, [dir="ltr"] a,
[dir="ltr"] td, [dir="ltr"] th, [dir="ltr"] label,
[dir="ltr"] input, [dir="ltr"] select, [dir="ltr"] textarea,
[dir="ltr"] button, [dir="ltr"] .btn,
[dir="ltr"] .form-control,
[dir="ltr"] .dropdown-item {
  font-family: 'Poppins', sans-serif !important;
}
/* ===== Cairo للسايدبار - عربي ===== */
[dir="rtl"] #sidebar-menu > ul > li > a,
[dir="rtl"] #sidebar-menu > ul > li > a span,
[dir="rtl"] #sidebar-menu .submenu li a,
[dir="rtl"] #sidebar-menu .menu-title,
[dir="rtl"] .side-menu,
[dir="rtl"] .side-menu * {
  font-family: 'Cairo', sans-serif !important;
  letter-spacing: 0 !important;
}

/* حجم الخط وثقله للقائمة الرئيسية */
[dir="rtl"] #sidebar-menu > ul > li > a {
  font-size: 14.5px !important;
  font-weight: 600 !important;
}

/* حجم الخط للقائمة الفرعية */
[dir="rtl"] #sidebar-menu .submenu li a {
  font-size: 13.5px !important;
  font-weight: 500 !important;
}

/* عنوان القسم */
[dir="rtl"] #sidebar-menu .menu-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: none !important;
}
