:root {
  --darb-dark: #2a2a2a;
  --darb-medium: #3a3a3a;
  --darb-orange: #8b6048;
  --darb-text: #ffffff;

  --glass: rgba(42, 42, 42, 0.88);
  --glass-2: rgba(58, 58, 58, 0.78);
  --border: rgba(255, 255, 255, 0.14);
  --muted: rgba(255, 255, 255, 0.72);

  --header-h: 40px;
  --footer-h: 100px;
  --sidebar-w: 290px;
  --radius: 14px;
}

body {
  font-family: "Cairo", sans-serif;
}

/* خلفية بسيطة رمادية (بدون ألوان إضافية) */
.backdrop {
  position: fixed;
  inset: 0;
  background: #4a4c4f;
  z-index: -2;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
  z-index: -1;
}

/* App viewport */
.app {
  position: relative;
  margin-top: var(--header-h);
  margin-bottom: var(--footer-h);
  height: calc(100vh - var(--header-h) - var(--footer-h));
  overflow: hidden;
}

/* Views */
.view {
  height: 100%;
  display: none;
}

.view.active {
  display: block;
}

/* Layout with right sidebar (like screenshot) */
.layout {
  height: 100%;
  display: flex;
  flex-direction: row-reverse;
  /* sidebar on right */
  gap: 0;
}

.app-sidebar {
  width: var(--sidebar-w);
  background: rgba(47, 49, 51, 0.7);
  border-radius: var(--radius);
  border-left: 1px solid var(--border);
  padding: 12px 0;
  overflow: auto;
  position: relative;
  height: 85vh;
}

.app-sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 66, 0.35);
  border-radius: 99px;
}

.sidebar-title {
  padding: 10px 14px 8px;
  font-size: 13px;
  color: var(--muted);
}

.side-item {
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  border-right: 3px solid transparent;
  transition: 0.2s;
  user-select: none;
}

.side-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.side-item.active {
  border-right-color: var(--darb-orange);
  background: rgba(255, 140, 66, 0.1);
  color: var(--darb-orange);
  font-weight: 700;
}

.side-item .ic {
  width: 13px;
  text-align: center;
}
.glass-card {
  padding-top: 70px;
}
.main {
  flex: 1;
  padding: 0 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Top bar inside main */
.panel {
  background: rgba(47, 49, 51, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* important for flex + overflow */
}

/* Jobs view */
.jobs-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(47, 49, 51, 0.8);
}

.jobs-top h1 {
  margin: 0;
  font-size: 18px;
  color: #c3c3c3;
}

.jobs-top small {
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.input,
.select {
  flex: 1;
  background: rgba(47, 49, 51, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
  color: #a6a8aa;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.select option {
  background: #2a2a2a;
}

.jobs-body {
  display: flex;
  gap: 12px;
  padding: 12px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
}

.jobs-list {
  flex: 1.4;
  overflow: auto;
  padding-right: 4px;
  min-height: 0;
}

.jobs-list::-webkit-scrollbar {
  width: 8px;
}

.jobs-list::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 66, 0.35);
  border-radius: 99px;
}

.job {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
  margin-top: 1px;
  cursor: pointer;
  transition: 0.2s;
}

.job:hover {
  border-color: rgba(255, 140, 66, 0.6);
  background: rgba(255, 140, 66, 0.06);
  transform: translateY(-1px);
}

.job.active {
  border-color: var(--darb-orange);
  box-shadow: 0 0 0 2px rgba(255, 140, 66, 0.15) inset;
}

.job-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.job-title {
  font-weight: 700;
  font-size: 14px;
  color: #b5b7ba;
  line-height: 1.2;
  margin-bottom: 12px;
}

.pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--muted);
  white-space: nowrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.preview {
  flex: 1;
  min-width: 290px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.12);
  padding: 12px;
  overflow: auto;
  min-height: 0;
  overflow-y: auto;
  max-height: 60vh;
}

.preview::-webkit-scrollbar {
  width: 8px;
}

.preview::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 66, 0.3);
  border-radius: 99px;
}

.preview h2 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--darb-orange);
}

.preview p {
  margin: 6px 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.6;
}

.preview small {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
  user-select: none;
}

.btn.primary {
    background: var(--darb-orange) !important;
    color: #4a4a4a !important;
}

.btn.primary:hover {
  transform: translateY(-1px) !important;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--darb-text) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

.btn.ghost:hover {
  border-color: rgba(255, 140, 66, 0.5);
  color: var(--darb-orange);
}

/* Wizard view */
.wizard-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.wizard-head h1 {
  margin: 0;
  font-size: 18px;
}

.wizard-summary {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wizard-summary b {
  color: var(--darb-text);
  font-weight: 800;
}

.progress {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  align-items: center;
  --bs-progress-bg:transparent;
}

.bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--darb-orange),
    rgba(255, 140, 66, 0.65)
  );
  border-radius: inherit;
  transition: width 0.25s;
}

.pct {
  width: 56px;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
}

.wizard-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  padding: 12px;
  gap: 10px;
}

.step-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.step-content::-webkit-scrollbar {
  width: 8px;
}

.step-content::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 66, 0.35);
  border-radius: 99px;
}

.group {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 12px;
}

.group h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--darb-orange);
}

@media (max-width: 980px) {
  .jobs-body {
    flex-direction: column;
  }

  .preview {
    min-width: unset;
  }

  .sidebar {
    width: 240px;
  }
}
@media (max-width: 768px) {

}
label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.field {
  width: 100%;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--darb-text);
  font-family: inherit;
  font-size: 13px;
}

.field:focus {
  outline: none;
  border-color: rgba(255, 140, 66, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.12);
}

.field[disabled] {
  opacity: 0.75;
  cursor: not-allowed;
}

textarea.field {
  min-height: 90px;
  resize: vertical;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.toast {
  position: fixed;
  bottom: calc(var(--footer-h) + 12px);
  left: 14px;
  background: rgba(42, 42, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--darb-text);
  padding: 10px 12px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 70;
  max-width: 360px;
  font-size: 13px;
}

.toast.show {
  display: block;
}

.toast b {
  color: var(--darb-orange);
}
/* ===== ضبط صفحة الوظائف في الموبايل والتابلت ===== */
@media (max-width: 991px) {

  .content-area.bg-img {
    overflow-y: auto;
  }

  .glass-card {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    border-radius: 0;
    padding:94px 15px 15px 15px;
  }

  .view,
  .view .layout,
  .view .main,
  .view .panel {
    height: auto;
  }

  .view .layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* 🔴 هنا نعدّل السايدبار */
  .app-sidebar {
    width: 100%;
    height: auto;        /* إلغاء 85vh في الموبايل */
    max-height: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .app-sidebar .sidebar-title {
    font-size: 12px;
    color: var(--accent-teal);
    flex: 0 0 auto;
    margin-inline-end: 6px;
    white-space: nowrap;
    padding: 0;
    display: none;
  }

  .app-sidebar .side-item {
    flex: 0 0 auto;
    white-space: nowrap;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    margin: 0;
  }

  #jobsView .main,
  #wizardView .main {
    width: 100%;
  }

  .jobs-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .jobs-top h1 {
    font-size: 20px;
  }

  .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .filters .input,
  .filters .select {
    width: 100%;
  }

  #jobsView .jobs-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: initial;
    min-height: auto;
  }

  #jobsView .jobs-list,
  #jobsView #jobPreview {
    max-height: none;
    overflow-y: visible;
  }

  #jobPreview {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  #wizardView .wizard-body {
    flex: initial;
    min-height: auto;
    max-height: none;
    overflow-y: visible;
    padding-inline-end: 0;
  }

  .wizard-actions {
    position: static;
    margin-top: 16px;
  }
}
/* ===== إصلاح اختفاء السايد بار في الموبايل ===== */
@media (max-width: 991px) {

  /* 1. ضبط الحاوية لتكون عمودية (السايد بار فوق، والمحتوى تحت) */
  .layout {
    display: flex !important;
    flex-direction: column !important; /* يجعل العناصر فوق بعض */
    overflow: visible !important;
  }

  /* 2. إظهار السايد بار كشريط أفقي */
  .app-sidebar {
    display: flex !important;      /* تفعيل الفليكس */
    flex-direction: row !important; /* ترتيب العناصر بجانب بعض */
    width: 100% !important;        /* عرض كامل */
    height: 0vh !important;       /* إلغاء الارتفاع الثابت القديم */
    min-height: 52px !important;   /* ضمان وجود ارتفاع أدنى لكي لا يختفي */
    overflow-x: auto !important;   /* السماح بالسكرول يمين ويسار */
    overflow-y: hidden !important;
    background: rgba(0, 0, 0, 0.25) !important; /* لون خلفية لتمييزه */
    padding: 14px 0 0 !important;
    margin-bottom: 7px !important; /* مسافة تفصله عن المحتوى تحته */
    margin-bottom: 0px !important;
    flex-shrink: 0 !important; /* يمنع انكماش السايد بار */
    padding-bottom: 0 !important;
    align-items: flex-end;
  }

  /* 3. منع انكماش عناصر القائمة (الأيقونات) */
  .app-sidebar .side-item {
    flex: 0 0 auto !important; /* يمنع النص من الالتفاف أو الاختفاء */
    width: auto !important;
    margin-left: 8px !important;
    border-right: none !important; /* إزالة الخط الجانبي */
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 3px 14px;
    background: rgba(255,255,255,0.05); /* لون خفيف للأزرار */
  }

  /* تمييز العنصر النشط */
  .app-sidebar .side-item.active {
    background: #8b6048 !important; /* اللون البرتقالي */
    color: #fff !important;
    border-color: #8b6048 !important;
  }
}
