/* ============================================================
   لوحة تحكم احترافية — دار ناشر للتعليم
   ============================================================ */
.admin-body {
  font-family: var(--m-font, "Tajawal", Tahoma, sans-serif);
  background: #f3f7f4;
  color: #1f2a24;
  min-height: 100vh;
  margin: 0;
}

/* ---------- التخطيط ---------- */
.a-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 262px; z-index: 60;
  background: linear-gradient(180deg, #0a2b4d 0%, #09203a 60%, #082a44 100%);
  color: #e5eef8; display: flex; flex-direction: column; overflow: hidden;
}
.a-main { margin-right: 262px; padding: 0; min-height: 100vh; }

/* ---------- البراند ---------- */
.a-brand {
  display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.a-logo {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #2e68a0, #1b4a7c); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(47,111,176,.4);
}
.a-brand b { font-size: 16px; display: block; line-height: 1.2; color: #fff; }
.a-brand small { font-size: 11px; color: #7f9fbd; display: block; }

/* ---------- القائمة ---------- */
.a-nav { flex: 1; overflow-y: auto; padding: 12px 0 16px; }
.a-nav::-webkit-scrollbar { width: 6px; }
.a-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 4px; }
.a-label {
  font-size: 11px; font-weight: 800; letter-spacing: .4px; color: #5f9478;
  padding: 16px 22px 7px; text-transform: uppercase;
}
.a-link {
  display: flex; align-items: center; gap: 12px; color: #b6d8c4; text-decoration: none;
  font-size: 14px; font-weight: 600; padding: 11px 20px; margin: 2px 12px; border-radius: 10px;
  transition: .17s; position: relative;
}
.a-link .ic {
  width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; transition: .17s;
}
.a-link .count {
  margin-inline-start: auto; background: rgba(255,255,255,.12); color: #e5eef8;
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
}
.a-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.a-link.active {
  background: linear-gradient(90deg, rgba(47,111,176,.22), rgba(47,111,176,.06));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(47,111,176,.35);
}
.a-link.active .ic { background: #2e68a0; color: #fff; }
.a-link.active::after {
  content: ""; position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 26px; border-radius: 4px; background: #93b9dc;
}

/* ---------- أسفل السايدبار ---------- */
.a-foot { padding: 14px 16px 16px; border-top: 1px solid rgba(255,255,255,.09); }
.a-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(255,255,255,.06); border-radius: 12px; margin-bottom: 10px; }
.a-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#93b9dc,#2e68a0);
  color: #05301e; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.a-user b { color: #fff; font-size: 13px; display: block; line-height: 1.3; }
.a-user small { color: #7f9fbd; font-size: 11px; }
.a-foot-links { display: flex; gap: 8px; }
.a-logout, .a-view {
  flex: 1; text-align: center; text-decoration: none; font-size: 12.5px; font-weight: 700;
  padding: 9px 6px; border-radius: 10px; transition: .17s;
}
.a-logout { background: rgba(244,63,94,.16); color: #fda4af; border: 1px solid rgba(244,63,94,.3); }
.a-logout:hover { background: #e11d48; color: #fff; }
.a-view { background: rgba(255,255,255,.08); color: #cddeef; border: 1px solid rgba(255,255,255,.1); }
.a-view:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- التوببار ---------- */
.a-topbar {
  background: #fff; border-bottom: 1px solid #e4ece6;
  padding: 16px 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 40;
}
.a-crumb { font-size: 12px; color: #8aa096; font-weight: 600; }
.a-crumb a { color: #1b4a7c; text-decoration: none; }
.a-crumb a:hover { text-decoration: underline; }
.a-topbar h1 { font-size: 22px; font-weight: 800; margin: 2px 0 0; color: #12281c; }
.a-top-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- زر عام ---------- */
.btn-p {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; text-decoration: none;
  font-family: var(--m-font); font-weight: 700; font-size: 13.5px; border: 1.5px solid transparent;
  padding: 9px 17px; border-radius: 10px; transition: .18s; white-space: nowrap;
}
.btn-p-p { background: linear-gradient(135deg,#2e68a0,#1b4a7c); color: #fff; box-shadow: 0 6px 16px rgba(47,111,176,.35); }
.btn-p-p:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(47,111,176,.42); }
.btn-p-g { background: #fff; color: #33413a; border-color: #dfe7e1; }
.btn-p-g:hover { border-color: #2e68a0; color: #1b4a7c; background: #edf8fb; }
.btn-p-d { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-p-d:hover { background: #fee2e2; }
.btn-p-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

/* ---------- المحتوى ---------- */
.a-content { padding: 26px 30px 60px; }

/* ---------- بطاقات إحصائية ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card {
  background: #fff; border: 1px solid #e8efe9; border-radius: 16px; padding: 20px;
  display: flex; gap: 15px; align-items: center; box-shadow: 0 1px 3px rgba(20,60,40,.05);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(20,60,40,.12); }
.stat-ic {
  width: 54px; height: 54px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 25px; flex-shrink: 0;
}
.stat-card .num { font-size: 26px; font-weight: 800; color: #12281c; line-height: 1.2; }
.stat-card .lbl { color: #7b8c82; font-size: 13px; font-weight: 600; }

/* ---------- البطاقات العامة ---------- */
.admin-card {
  background: #fff; border: 1px solid #e8efe9; border-radius: 16px;
  padding: 24px; margin-bottom: 22px; box-shadow: 0 1px 3px rgba(20,60,40,.05);
}
.admin-card h2 { font-size: 16.5px; font-weight: 800; color: #12281c; margin-bottom: 18px; display: flex; align-items: center; gap: 9px; }
.admin-card h2 .dot { width: 8px; height: 8px; border-radius: 3px; background: #2e68a0; display: inline-block; }

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #edf2ee; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
.admin-table th, .admin-table td { text-align: right; padding: 12px 15px; border-bottom: 1px solid #eef2ef; white-space: nowrap; }
.admin-table th { background: #f6faf7; color: #5f7567; font-size: 11.5px; font-weight: 800; letter-spacing: .2px; }
.admin-table tbody tr { transition: background .13s; }
.admin-table tbody tr:hover { background: #f8fcf9; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td b { color: #1f2a24; }
.admin-table .thumb { width: 40px; height: 56px; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.admin-table .thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-table .sub { font-size: 12px; color: #91a8b3; }

/* ---------- شارات الحالة ---------- */
.badge-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 30px; font-size: 12px; font-weight: 700; }
.badge-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-new { background: #fff7ed; color: #c2410c; }
.badge-paid { background: #eff6ff; color: #1d4ed8; }
.badge-shipped { background: #e9f0f7; color: #1b4a7c; }
.badge-done { background: #f0fdf4; color: #143c63; }
.badge-cancel { background: #fef2f2; color: #b91c1c; }

/* ---------- الأزرار الصغيرة ---------- */
.actions-row { display: flex; gap: 8px; }
.mini-btn {
  padding: 6px 13px; border-radius: 8px; font-size: 12px; font-weight: 700; text-decoration: none;
  border: 1.4px solid #dfe7e1; background: #fff; color: #55655c; cursor: pointer; font-family: var(--m-font); transition: .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.mini-btn:hover { border-color: #2e68a0; color: #1b4a7c; background: #edf8fb; }
.mini-btn.primary { background: #1b4a7c; color: #fff; border-color: #1b4a7c; }
.mini-btn.primary:hover { background: #143c63; color: #fff; }
.mini-btn.danger { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.mini-btn.danger:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

/* ---------- النماذج ---------- */
.input {
  width: 100%; padding: 11px 15px; border: 1.5px solid #dfe7e1; border-radius: 11px;
  font-size: 14px; font-family: var(--m-font); background: #fbfdfc; transition: .16s; color: #1f2a24;
}
.input:focus { outline: none; border-color: #2e68a0; background: #fff; box-shadow: 0 0 0 3px rgba(47,111,176,.16); }
textarea.input { resize: vertical; min-height: 92px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; color: #415449; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- شرائح التصنيف ---------- */
.chips { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 8px 19px; border-radius: 30px; background: #fff; border: 1.4px solid #dfe7e1;
  color: #6b7d72; font-size: 13.5px; font-weight: 700; text-decoration: none; transition: .16s;
}
.chip:hover { border-color: #2e68a0; color: #1b4a7c; }
.chip.active { background: #1b4a7c; border-color: #1b4a7c; color: #fff; box-shadow: 0 5px 14px rgba(47,111,176,.28); }

/* ---------- التنبيهات ---------- */
.alert { padding: 13px 17px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #e9f0f7; color: #12536b; border: 1px solid #a7c6e6; }

/* ---------- شاشة الدخول ---------- */
.a-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(circle at 20% 10%, #124a75 0%, transparent 50%), radial-gradient(circle at 85% 90%, #1b4a7c 0%, transparent 45%), linear-gradient(135deg, #081f38, #0a2b4d);
}
.a-login-card {
  width: 400px; background: #fff; border-radius: 22px; padding: 36px 34px;
  box-shadow: 0 30px 70px rgba(2,20,12,.45); position: relative; overflow: hidden;
}
.a-login-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 5px; background: linear-gradient(90deg,#93b9dc,#1b4a7c); }
.a-login-head { text-align: center; margin-bottom: 24px; }
.a-login-head .a-logo { width: 58px; height: 58px; font-size: 28px; border-radius: 16px; margin: 0 auto 12px; }
.a-login-head h1 { font-size: 21px; font-weight: 800; color: #12281c; margin-bottom: 3px; }
.a-login-head p { color: #7b8c82; font-size: 13px; }
.a-login-note { margin-top: 16px; text-align: center; font-size: 12px; color: #91a8b3; background: #f3f8f5; border: 1px dashed #cfe6d8; padding: 8px; border-radius: 9px; }

/* ---------- استجابة ---------- */
@media (max-width: 920px) {
  .a-sidebar { position: static; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 12px; }
  .a-nav { display: flex; overflow-x: auto; padding: 6px 0; order: 3; width: 100%; }
  .a-label { display: none; }
  .a-link { margin: 2px; padding: 8px 13px; white-space: nowrap; }
  .a-link .ic { width: 26px; height: 26px; font-size: 13px; }
  .a-link.active::after { display: none; }
  .a-foot { order: 2; border: 0; padding: 4px 8px; }
  .a-user { display: none; }
  .a-foot-links { gap: 6px; }
  .a-logout, .a-view { padding: 7px 10px; font-size: 11.5px; }
  .a-main { margin-right: 0; }
  .a-brand { padding: 6px 8px; border: 0; }
  .a-content { padding: 18px 16px 50px; }
  .a-topbar { padding: 12px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}