/* ══════════════════════════════════════════
   قطون — style.css
   ══════════════════════════════════════════ */

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

:root {
  --brand:       #F0B429;
  --brand-dark:  #D49D1B;
  --brand-light: #FEF3C7;
  --dark:        #111827;
  --text:        #1F2937;
  --muted:       #6B7280;
  --border:      #E5E7EB;
  --bg:          #F9FAFB;
  --white:       #FFFFFF;
  --sidebar-w:   230px;
  --radius:      12px;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,.1);
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
}

.hidden  { display: none !important; }
.w-full  { width: 100%; }
.mt      { margin-top: 8px; }

/* ══════ تسجيل الدخول ══════ */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFFBEB 0%, #F9FAFB 100%);
  padding: 20px;
}

.login-box {
  background: var(--white);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,.1);
}

.login-logo {
  font-size: 26px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 28px;
}

.login-logo .dot, .sidebar-logo .dot { color: var(--brand); }

.logo-img         { height: 36px; width: auto; object-fit: contain; }
.logo-img-sidebar { height: 32px; filter: brightness(0) invert(1); }

.login-box h1   { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.login-sub      { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* حقول الإدخال */
.field             { margin-bottom: 16px; }
.field label       { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input       { width: 100%; height: 44px; border: 1.5px solid var(--border); border-radius: 10px;
                     padding: 0 14px; font-family: 'Cairo', sans-serif; font-size: 14px;
                     color: var(--text); outline: none; transition: border-color .2s; }
.field input:focus { border-color: var(--brand); }

.pass-wrap         { position: relative; }
.pass-wrap input   { padding-left: 40px; }
.pass-wrap button  { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
                     background: none; border: none; cursor: pointer; color: var(--muted);
                     display: flex; align-items: center; padding: 0; }
.pass-wrap button:hover { color: var(--text); }

.forgot-btn { background: none; border: none; color: var(--muted); font-family: 'Cairo', sans-serif;
              font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; }
.forgot-btn:hover { color: var(--brand-dark); }

.login-row        { display: flex; align-items: center; justify-content: space-between;
                    margin-top: -4px; margin-bottom: 6px; }
.remember-label   { display: flex; align-items: center; gap: 6px; font-size: 13px;
                    color: var(--muted); cursor: pointer; }
.remember-label input { width: auto; height: auto; accent-color: var(--brand); cursor: pointer; }

.error-msg { background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626;
             font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }

/* ══════ أزرار ══════ */
.btn-primary {
  background: var(--brand); color: var(--dark); border: none;
  border-radius: 10px; height: 44px; padding: 0 20px;
  font-family: 'Cairo', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .2s, transform .1s; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-primary:hover  { background: var(--brand-dark); }
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
  background: var(--white); color: var(--text); border: 1.5px solid var(--border);
  border-radius: 10px; height: 44px; padding: 0 20px;
  font-family: 'Cairo', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand-dark); }

.btn-danger {
  background: #FEF2F2; color: #DC2626; border: none;
  border-radius: 8px; height: 36px; padding: 0 14px;
  font-family: 'Cairo', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; border-radius: 9px; }

.btn-approve {
  background: #F0FDF4; color: #16A34A; border: 1.5px solid #BBF7D0;
  border-radius: 10px; height: 40px; padding: 0 20px;
  font-family: 'Cairo', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-approve:hover { background: #DCFCE7; }

.btn-reject {
  background: #FEF2F2; color: #DC2626; border: 1.5px solid #FECACA;
  border-radius: 10px; height: 40px; padding: 0 20px;
  font-family: 'Cairo', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-reject:hover { background: #FEE2E2; }

/* ══════ تخطيط التطبيق ══════ */
#app { display: flex; min-height: 100vh; }

/* الشريط الجانبي */
#sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0; top: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-top  { flex: 1; padding: 24px 14px 16px; }
.sidebar-logo { font-size: 22px; font-weight: 800; color: var(--white); margin-bottom: 28px; padding: 0 8px; }

#sidebar-nav  { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px;
  color: #9CA3AF; text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: all .2s;
}
.nav-item svg    { flex-shrink: 0; }
.nav-item:hover  { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active { background: var(--brand); color: var(--dark); font-weight: 700; }

.sidebar-bottom {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.user-card  { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; }
.user-info  { min-width: 0; }
.user-name  { color: var(--white); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { color: #6B7280; font-size: 11px; margin-top: 1px; }

.logout-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; background: none; border: none; border-radius: 10px;
  color: #6B7280; font-family: 'Cairo', sans-serif; font-size: 13px;
  font-weight: 500; cursor: pointer; transition: all .2s;
}
.logout-btn:hover { background: rgba(239,68,68,.1); color: #EF4444; }

/* المحتوى الرئيسي */
#main-content {
  margin-right: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#main-header {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 16px 28px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 40;
}
#page-title      { font-size: 18px; font-weight: 800; }
#header-actions  { display: flex; gap: 8px; }

.page-section { padding: 28px; flex: 1; }

/* Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: var(--dark);
  font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-lg { width: 48px; height: 48px; font-size: 20px; }
.avatar-xl { width: 60px; height: 60px; font-size: 26px; }

/* ══════ بطاقات الإحصائيات ══════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 46px; height: 46px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

.stat-num   { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ══════ الشارات ══════ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-new      { background: #EFF6FF; color: #2563EB; }
.badge-review   { background: #FFFBEB; color: #D97706; }
.badge-approved { background: #F0FDF4; color: #16A34A; }
.badge-rejected { background: #FEF2F2; color: #DC2626; }
.badge-admin    { background: #F5F3FF; color: #7C3AED; }

/* ══════ الطلبات ══════ */
.requests-list { display: flex; flex-direction: column; gap: 12px; }

.request-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all .2s; box-shadow: var(--shadow);
}
.request-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand); }

.req-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--brand-light); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}

.req-info   { flex: 1; min-width: 0; }
.req-title  { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-meta   { font-size: 12px; color: var(--muted); margin-top: 3px; }
.req-badge  { flex-shrink: 0; }

/* ══════ الموظفون ══════ */
.employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.employee-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  box-shadow: var(--shadow); transition: box-shadow .2s;
}
.employee-card:hover { box-shadow: var(--shadow-md); }

.emp-name   { font-size: 15px; font-weight: 700; margin-top: 12px; }
.emp-title  { font-size: 12px; color: var(--muted); margin-top: 2px; }

.emp-details { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.emp-details span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.emp-actions { margin-top: 16px; display: flex; gap: 8px; }

/* ══════ الإعلانات ══════ */
.ann-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); border-right: 4px solid var(--brand);
  padding: 18px 20px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.ann-card.important { border-right-color: #EF4444; }
.ann-title  { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.ann-body   { font-size: 13px; color: var(--muted); line-height: 1.8; }
.ann-meta   { font-size: 11px; color: #9CA3AF; margin-top: 10px; }

/* ══════ المودال ══════ */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}

#modal-box {
  background: var(--white); border-radius: 18px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-close {
  background: none; border: none; font-size: 18px; color: var(--muted);
  cursor: pointer; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background .2s;
}
.modal-close:hover { background: var(--bg); }

#modal-body { padding: 20px 24px 28px; }

/* حقول المودال */
.mfield             { margin-bottom: 14px; }
.mfield label       { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.mfield input,
.mfield select,
.mfield textarea    { width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
                       padding: 9px 12px; font-family: 'Cairo', sans-serif; font-size: 14px;
                       color: var(--text); outline: none; background: var(--white); transition: border-color .2s; }
.mfield input:focus,
.mfield select:focus,
.mfield textarea:focus { border-color: var(--brand); }
.mfield textarea    { min-height: 90px; resize: vertical; line-height: 1.7; }

.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-foot  { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* التفاصيل */
.detail-row   { display: flex; gap: 12px; margin-bottom: 12px; font-size: 14px; }
.detail-label { font-weight: 700; min-width: 130px; flex-shrink: 0; }
.detail-value { color: var(--muted); }
.approve-row  { display: flex; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

/* فارغ */
.empty {
  text-align: center; padding: 64px 20px;
  color: var(--muted);
}
.empty .empty-icon { font-size: 52px; margin-bottom: 14px; opacity: .4; display: block; }
.empty p           { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

/* الحساب */
.profile-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 28px;
  box-shadow: var(--shadow); max-width: 540px;
}
.profile-top   { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.profile-name  { font-size: 20px; font-weight: 800; }
.profile-title { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* قسم على الداش */
.section-label { font-size: 16px; font-weight: 800; margin-bottom: 16px; color: var(--text); }

/* ══════ الاستجابة للشاشات الصغيرة ══════ */
@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }
  #sidebar     { display: none; }
  #main-content { margin-right: 0; }
  .stats-grid  { grid-template-columns: 1fr 1fr; }
  .form-row    { grid-template-columns: 1fr; }
  .page-section { padding: 16px; }
  #main-header  { padding: 14px 16px; }
}
