/* ==================================================================
   assets/css/style.css
   تنسيقات عامة تُستخدم فوق Bootstrap RTL في كل صفحات المنصة.
   الخط: Cairo (خط عربي واضح ومريح للوحات التحكم)
   ================================================================== */

:root {
  --brand-primary: #2f6f4f;      /* أخضر لوحي - يوحي بالمؤسسات التعليمية */
  --brand-primary-dark: #1f4d36;
  --brand-accent: #d98e04;       /* عنبري للتنبيهات/الإبراز */
  --brand-danger: #c0392b;
  --bg-soft: #f5f7f6;
  --sidebar-width: 260px;
  --radius-base: 10px;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--bg-soft);
  direction: rtl;
  text-align: right;
}

/* ---------- شاشات الدخول (تسجيل / تسجيل دخول) ---------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--brand-primary-dark), var(--brand-primary));
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: var(--radius-base);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  padding: 2.25rem 2rem;
}

.auth-card .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--brand-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* ---------- القائمة الجانبية (Sidebar) ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--brand-primary-dark);
  color: #eaf3ee;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: margin-right .25s ease;
}

.sidebar .brand {
  padding: 1.25rem 1.25rem 1rem;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar .nav-link {
  color: #cfe3d7;
  padding: .65rem 1.25rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .93rem;
}

.sidebar .nav-link i { width: 20px; text-align: center; }

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-inline-start: 3px solid var(--brand-accent);
}

.sidebar .nav-section-title {
  padding: 1rem 1.25rem .35rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #86a99a;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e6e9e8;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-body { padding: 1.5rem; }

/* ---------- بطاقات الإحصائيات ---------- */
.stat-card {
  border: none;
  border-radius: var(--radius-base);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  padding: 1.1rem 1.25rem;
  height: 100%;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand-primary-dark);
}

.stat-card .stat-label {
  color: #6b7a75;
  font-size: .85rem;
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(47,111,79,.1);
  color: var(--brand-primary);
}

/* ---------- جدول الحصص (Grid) ---------- */
.timetable-grid {
  display: grid;
  gap: 4px;
  overflow-x: auto;
}

.tt-cell {
  background: #fff;
  border: 1px solid #e6e9e8;
  border-radius: 8px;
  min-height: 64px;
  padding: 6px 8px;
  font-size: .82rem;
  position: relative;
  cursor: grab;
}

.tt-cell.tt-empty {
  background: repeating-linear-gradient(45deg, #fafbfa, #fafbfa 8px, #f1f3f2 8px, #f1f3f2 16px);
  cursor: default;
}

.tt-cell.tt-conflict {
  border-color: var(--brand-danger);
  background: #fdecea;
  animation: pulse-danger 1.1s ease-in-out infinite;
}

@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,.35); }
  50% { box-shadow: 0 0 0 5px rgba(192,57,43,0); }
}

.tt-cell .tt-subject { font-weight: 700; display: block; }
.tt-cell .tt-meta { color: #6b7a75; font-size: .72rem; }

.tt-head-cell {
  font-weight: 700;
  text-align: center;
  padding: 8px 4px;
  color: var(--brand-primary-dark);
}

/* ---------- عام ---------- */
.btn-brand {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.btn-brand:hover { background: var(--brand-primary-dark); color: #fff; }

.badge-waiting { background: var(--brand-accent); }

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    right: 0;
    z-index: 1040;
    margin-right: calc(-1 * var(--sidebar-width));
  }
  .sidebar.show { margin-right: 0; }
  .main-content { width: 100%; }
}
