/* ===== لوحة التحكم — تصميم عربي متجاوب ===== */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body.admin-body{
  font-family:'Tajawal','Cairo',system-ui,-apple-system,'Segoe UI',sans-serif;
  background:#f4f6fb;color:#1f2937;direction:rtl;text-align:right;
  min-height:100vh;
}
a{color:#2563eb;text-decoration:none}
a:hover{text-decoration:underline}

/* ===== القائمة الجانبية ===== */
.sidebar{
  position:fixed;top:0;right:0;bottom:0;width:250px;
  background:#111827;color:#e5e7eb;padding:1.25rem 1rem;
  display:flex;flex-direction:column;z-index:50;
  transition:transform .25s ease;
}
.brand{font-size:1.15rem;font-weight:700;margin-bottom:1.5rem;color:#fff}
.brand span{margin-right:.35rem}
.menu{display:flex;flex-direction:column;gap:.25rem;flex:1}
.menu-item{
  display:flex;align-items:center;gap:.65rem;
  padding:.7rem .85rem;border-radius:.6rem;
  color:#cbd5e1;font-size:.95rem;transition:background .15s;
}
.menu-item:hover{background:#1f2937;color:#fff;text-decoration:none}
.menu-item.active{background:#2563eb;color:#fff}
.menu-item .ico{font-size:1.05rem}
.sidebar-foot{border-top:1px solid #1f2937;padding-top:1rem;margin-top:1rem}
.who{font-size:.85rem;color:#9ca3af;margin-bottom:.4rem}
.logout{color:#f87171;font-size:.9rem}

/* ===== المحتوى ===== */
.content{margin-right:250px;padding:1.5rem;min-height:100vh}
.topbar{
  display:flex;justify-content:space-between;align-items:center;
  background:#fff;padding:1rem 1.25rem;border-radius:.75rem;
  box-shadow:0 1px 3px rgba(0,0,0,.05);margin-bottom:1.25rem;
  flex-wrap:wrap;gap:.5rem;
}
.topbar h1{margin:0;font-size:1.25rem;font-weight:700;color:#111827}
.muted{color:#6b7280;font-size:.85rem}
.page{background:#fff;padding:1.25rem;border-radius:.75rem;box-shadow:0 1px 3px rgba(0,0,0,.05)}

/* ===== شبكة البطاقات ===== */
.cards,.stats-grid{
  display:grid;gap:1rem;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  margin-bottom:1.25rem;
}
.card,.stat-card{
  background:#fff;padding:1.1rem;border-radius:.75rem;
  border:1px solid #e5e7eb;box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.card h3,.stat-card h3{margin:0 0 .4rem;font-size:.85rem;color:#6b7280;font-weight:500}
.card .val,.stat-card .value{font-size:1.7rem;font-weight:700;color:#111827}

/* ===== جداول ===== */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:.92rem;background:#fff}
th,td{padding:.7rem .85rem;text-align:right;border-bottom:1px solid #e5e7eb}
th{background:#f9fafb;font-weight:600;color:#374151}
tr:hover td{background:#f9fafb}

/* ===== نماذج وأزرار ===== */
label{display:block;font-weight:600;margin:.5rem 0 .35rem;color:#374151}
input[type=text],input[type=email],input[type=password],input[type=number],input[type=url],select,textarea{
  width:100%;padding:.6rem .75rem;border:1px solid #d1d5db;border-radius:.5rem;
  font:inherit;background:#fff;color:#111827;
}
input:focus,select:focus,textarea:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.15)}
textarea{min-height:110px;resize:vertical}
.btn,button.btn,input[type=submit]{
  display:inline-block;background:#2563eb;color:#fff;border:0;
  padding:.6rem 1.1rem;border-radius:.5rem;font-weight:600;cursor:pointer;
  font:inherit;transition:background .15s;
}
.btn:hover,button.btn:hover,input[type=submit]:hover{background:#1d4ed8;text-decoration:none}
.btn.secondary{background:#e5e7eb;color:#111827}
.btn.danger{background:#dc2626}
.badge{display:inline-block;padding:.2rem .55rem;border-radius:1rem;font-size:.75rem;background:#e5e7eb;color:#374151}
.badge.ok{background:#dcfce7;color:#166534}
.badge.err{background:#fee2e2;color:#991b1b}
.alert{padding:.75rem 1rem;border-radius:.5rem;margin-bottom:1rem}
.alert.success{background:#dcfce7;color:#166534;border:1px solid #bbf7d0}
.alert.error{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}

/* ===== زر القائمة للهاتف ===== */
.menu-toggle{
  display:none;position:fixed;top:.75rem;right:.75rem;z-index:60;
  background:#111827;color:#fff;border:0;font-size:1.4rem;
  width:44px;height:44px;border-radius:.5rem;cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
}
.backdrop{
  display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:40;
}
.backdrop.show{display:block}

/* ===== شاشات الهاتف ===== */
@media (max-width: 900px){
  .sidebar{transform:translateX(100%);width:80%;max-width:300px}
  .sidebar.open{transform:translateX(0)}
  .content{margin-right:0;padding:4rem 1rem 1rem}
  .menu-toggle{display:flex;align-items:center;justify-content:center}
  .topbar{padding:.85rem 1rem}
  .topbar h1{font-size:1.05rem}
  .card .val,.stat-card .value{font-size:1.4rem}
}

/* ===== صفحة تسجيل الدخول ===== */
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:1rem;background:#f4f6fb}
.login-card{background:#fff;padding:2rem;border-radius:1rem;box-shadow:0 10px 25px rgba(0,0,0,.08);width:100%;max-width:380px}
.login-card h1{margin:0 0 1.25rem;font-size:1.4rem;text-align:center;color:#111827}
