/* =========================================================
   إضافات النظام فوق القالب الأصلي (لا تعدّل ملفات القالب)
   ========================================================= */
body { font-family: "Segoe UI", Tahoma, Arial, sans-serif; background: #f6f8fa; display: block; }

/* ---- القائمة الجانبية: ثابتة وتتمدد فوق المحتوى ---- */
.menu {
    position: fixed; top: 0; right: 0; z-index: 100;
    background: #fff; border-left: 1px solid #e3e8ee;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
}
.menu::-webkit-scrollbar { display: none; }
.menu:hover { box-shadow: -4px 0 18px rgba(0,0,0,.12); }
.menu ul { height: auto; min-height: calc(100vh - 40px); }
.menu ul li a { margin: 8px 0; }
.menu ul li.active { background-color: #7ac142; }
.menu ul li.active a { color: #fff; }
.menu ul li a p { white-space: nowrap; }
.content { width: auto; margin: 10px 80px 20px 14px; }

/* ---- شريط الأدوات (الجديد/تعديل/حذف...) ---- */
.nav-control > ul { display: flex; flex-wrap: wrap; }
.nav-control > ul > li { float: none; }
.nav-control > ul > li > a { color: #fff; cursor: pointer; }
.nav-control > ul > li > a i { margin-left: 6px; }
.nav-control ul li ul li label { cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 7px 10px; white-space: nowrap; }
.nav-control ul li ul li label input { padding: 0; width: auto; accent-color: #7ac142; }

/* ---- البحث ---- */
.serch_box { margin: 10px 0; }
.serch_box form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.serch_box .text_serch { width: 280px; max-width: 100%; }
.serch_box select { min-width: 140px; }

/* ---- أزرار ---- */
.btn { display: inline-block; width: auto; padding: 10px 20px; font-size: 15px; border-radius: 6px;
       background: #7ac142; color: #fff; border: 0; cursor: pointer; text-decoration: none; }
.btn:hover { background: #42c16e; }
.btn-secondary { background: #6c7a89; }
.btn-secondary:hover { background: #55606c; }
.btn-danger { background: #e53935; }
.btn-danger:hover { background: #c62828; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---- أيقونات الإجراءات في الصفوف ---- */
.bt-icon { cursor: pointer; }
.bt-icon.danger { color: #e53935; }
.bt-icon.dark { color: #555; }
.row-actions { white-space: nowrap; }
.row-actions a { text-decoration: none; }

/* ---- تنبيهات ---- */
.alert { padding: 12px 16px; border-radius: 8px; margin: 10px 0; font-size: 15px; }
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.alert-error   { background: #ffebee; color: #b71c1c; border: 1px solid #ef9a9a; }
.alert-info    { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.alert-warning { background: #fff8e1; color: #8a5a00; border: 1px solid #ffe082; }
.alert ul { margin: 6px 20px 0 0; }

/* ---- شارات الحالة ---- */
.badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 12px; color: #fff; }
.b-green  { background: #43a047; }
.b-red    { background: #e53935; }
.b-orange { background: #fb8c00; }
.b-blue   { background: #1e88e5; }
.b-gray   { background: #78909c; }
.muted { color: #aaa; }
.exp-past { color: #d32f2f; font-weight: 700; }
.exp-soon { color: #ef6c00; font-weight: 700; }

/* ---- النماذج ---- */
.container { margin-top: 10px; }
.container h2 { margin-bottom: 18px; }
input[type=checkbox], input[type=radio] { padding: 0; width: auto; }
.form-group.has-error input, .form-group.has-error select, .form-group.has-error textarea { border-color: #e53935; }
.form-group small.err { color: #d32f2f; margin-top: 4px; }
.form-group small.help { color: #78909c; margin-top: 4px; }
.form-group textarea { padding: 10px; border: 1px solid #7ac142; border-radius: 6px; font-size: 15px; font-family: inherit; min-height: 90px; resize: vertical; }
.form-group textarea:focus { border-color: #7ac142; outline: none; }
.ltr { direction: ltr; text-align: right; }
select:disabled, input:disabled, input[readonly] { background: #eef1f4; }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }
.form-actions button { flex: 3; }
.form-actions .btn { flex: 1; text-align: center; font-size: 18px; padding: 14px; }
.req { color: #e53935; }

/* ---- الأدوار والصلاحيات ---- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.perm-grid label { font-weight: normal; display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.perm-grid input { accent-color: #7ac142; }
.perm-tools { margin-bottom: 10px; font-size: 13px; }
.perm-tools a { color: #1976d2; cursor: pointer; margin-left: 12px; }
.role-chip { display: inline-block; background: #eef6e6; border: 1px solid #7ac142; border-radius: 12px; padding: 2px 10px; margin: 2px; font-size: 12px; }

/* ---- الجدول ---- */
.data-table thead th a { color: inherit; text-decoration: none; }
.data-table thead th .sort-ico { font-size: 11px; opacity: .6; margin-right: 4px; }
.data-table.compact { min-width: 0; }
.table-footer { min-width: 0; flex-wrap: wrap; }
.empty-row td { height: 80px !important; color: #888; }
details.json summary { cursor: pointer; color: #1976d2; }
details.json pre { text-align: left; direction: ltr; white-space: pre-wrap; max-width: 420px; font-size: 12px; background: #f4f6f8; padding: 8px; border-radius: 6px; margin-top: 6px; }

/* ---- لوحة التحكم ---- */
.data-info .box .empty { color: #999; position: static; margin: 0; }

/* ---- صفحة الدخول ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #eef6e6, #f6f8fa); }
.login-card { background: #fff; width: 380px; max-width: 92vw; padding: 32px; border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,.12); border-top: 5px solid #7ac142; }
.login-card .logo { text-align: center; margin-bottom: 10px; }
.login-card .logo img { width: 90px; }
.login-card h2 { margin-bottom: 18px; }
.login-card .form-group { margin-bottom: 14px; }

@media (max-width: 768px) {
    .content { margin-right: 70px; }
    .serch_box .text_serch { width: 100%; }
}
