/* ==========================================================================
   نظام العبء التدريسي والجدول الأسبوعي الموحد - جامعة المأمون
   تصميم وهوية أكاديمية ملكية (Royal Navy & Imperial Gold)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  /* Core Color Palette */
  --color-navy-dark: #071321;
  --color-navy-primary: #0B192C;
  --color-navy-light: #1E3E62;
  --color-navy-accent: #2A5485;

  --color-gold-light: #FDE68A;
  --color-gold-primary: #D4AF37;
  --color-gold-dark: #997B1E;
  --color-gold-gradient: linear-gradient(135deg, #F9DF7B 0%, #D4AF37 50%, #B8860B 100%);

  /* Neutrals */
  --color-bg: #F1F5F9;
  --color-surface: #FFFFFF;
  --color-surface-hover: #F8FAFC;
  --color-border: #E2E8F0;
  --color-border-focus: #D4AF37;
  --color-text-main: #0F172A;
  --color-text-muted: #64748B;
  --color-text-light: #94A3B8;

  /* Status Colors */
  --color-success-bg: #ECFDF5;
  --color-success-text: #065F46;
  --color-success-border: #A7F3D0;
  --color-success-badge: #10B981;

  --color-danger-bg: #FEF2F2;
  --color-danger-text: #991B1B;
  --color-danger-border: #FECACA;
  --color-danger-badge: #EF4444;

  --color-info-bg: #EFF6FF;
  --color-info-text: #1E40AF;
  --color-info-border: #BFDBFE;
  --color-info-badge: #3B82F6;

  --color-warning-bg: #FFFBEB;
  --color-warning-text: #92400E;
  --color-warning-border: #FDE68A;

  /* Typography */
  --font-main: 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;

  /* Shadows & Radii */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(11, 25, 44, 0.08), 0 2px 4px -2px rgba(11, 25, 44, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(11, 25, 44, 0.1), 0 4px 6px -4px rgba(11, 25, 44, 0.05);
  --shadow-gold: 0 4px 14px 0 rgba(212, 175, 55, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Top Branding Bar */
.top-navbar {
  background: var(--color-navy-primary);
  color: #FFF;
  border-bottom: 2px solid var(--color-gold-primary);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.navbar-logo-img {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  color: #CBD5E1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #FFFFFF;
  background: var(--color-navy-light);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--color-gold-primary);
  border-radius: var(--radius-full);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Secondary Subheader / Status Strip */
.sub-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.sub-header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.dept-badge-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy-primary);
}

.dept-badge-tag {
  background: #FEF3C7;
  color: #92400E;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #FCD34D;
}

.sub-header-quick-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.stat-inline-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-inline-item strong {
  color: var(--color-navy-primary);
  font-weight: 700;
}

/* Main Content Container */
.main-wrapper {
  max-width: 1400px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  flex: 1;
}

/* Dashboard Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--color-gold-primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.metric-card.success::before { background: var(--color-success-badge); }
.metric-card.danger::before { background: var(--color-danger-badge); }
.metric-card.info::before { background: var(--color-info-badge); }

.metric-info h3 {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.metric-info .value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-navy-primary);
  line-height: 1.2;
}

.metric-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-navy-light);
  border: 1px solid var(--color-border);
}

/* Cards & Sections */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.card-header {
  padding: 1.2rem 1.5rem;
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  text-align: right;
}

.table th {
  background: #F8FAFC;
  color: var(--color-navy-primary);
  font-weight: 700;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  color: #334155;
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background-color: var(--color-surface-hover);
}

.table-instructor-row {
  background: #F8FAFC;
  font-weight: 700;
  border-top: 2px solid #CBD5E1;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border: 1px solid var(--color-danger-border);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info-text);
  border: 1px solid var(--color-info-border);
}

.badge-gold {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.badge-navy {
  background: var(--color-navy-primary);
  color: #FFF;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-family: var(--font-main);
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  line-height: 1.4;
}

.btn-primary {
  background: var(--color-gold-gradient);
  color: var(--color-navy-dark);
  font-weight: 700;
  border: 1px solid var(--color-gold-dark);
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-navy {
  background: var(--color-navy-primary);
  color: #FFFFFF;
  border: 1px solid var(--color-navy-light);
}

.btn-navy:hover {
  background: var(--color-navy-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-navy-primary);
  border: 1px solid var(--color-border);
}

.btn-outline:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-outline-gold {
  background: transparent;
  color: var(--color-gold-dark);
  border: 1px solid var(--color-gold-primary);
}

.btn-outline-gold:hover {
  background: #FFFBEB;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.825rem;
}

.btn-danger-soft {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.btn-danger-soft:hover {
  background: #FCA5A5;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy-primary);
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-family: var(--font-main);
  font-size: 0.925rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: #FFF;
  color: var(--color-text-main);
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Weekly Timetable Matrix */
.schedule-table-wrapper {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #FFF;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold-primary) #F1F5F9;
}

.schedule-table-wrapper::-webkit-scrollbar {
  height: 9px;
}

.schedule-table-wrapper::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 6px;
}

.schedule-table-wrapper::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 6px;
  border: 2px solid #F1F5F9;
}

.schedule-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-primary);
}

.schedule-matrix {
  display: grid;
  grid-template-columns: minmax(175px, 195px) repeat(6, minmax(190px, 1fr));
  min-width: 1350px;
  background: #FFF;
  position: relative;
}

.matrix-header {
  background: var(--color-navy-primary);
  color: #FFF;
  padding: 0.8rem 0.5rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.92rem;
  border-bottom: 2.5px solid var(--color-gold-primary);
  border-left: 1px solid rgba(255,255,255,0.12);
  position: sticky;
  top: 0;
  z-index: 20;
}

.matrix-header:first-child {
  position: sticky;
  right: 0;
  top: 0;
  z-index: 30;
  background: #0B192C;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.15);
}

.matrix-time-col {
  background: #F8FAFC;
  padding: 0.75rem 0.6rem;
  text-align: center;
  font-weight: 800;
  color: var(--color-navy-primary);
  border-bottom: 1px solid var(--color-border);
  border-left: 2px solid #CBD5E1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  position: sticky;
  right: 0;
  z-index: 15;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.07);
  box-sizing: border-box;
  overflow: visible;
}

.time-slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  width: 95%;
  max-width: 175px;
}

.time-slot-val {
  font-weight: 900;
  font-size: 0.92rem;
  color: #071321;
  direction: ltr;
  unicode-bidi: isolate;
  letter-spacing: 0.4px;
}

.matrix-slot {
  min-height: 95px;
  padding: 0.6rem;
  border-bottom: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  background: #FFFFFF;
  position: relative;
  transition: var(--transition);
}

.matrix-slot:hover {
  background-color: #F8FAFC;
}

.schedule-card-slot {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-right: 3.5px solid #2563EB;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.schedule-card-slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.09);
}

.schedule-card-slot.practical {
  background: #F0FDF4;
  border-color: #BBF7D0;
  border-right-color: #16A34A;
}

.slot-subject {
  font-weight: 800;
  color: #1E3A8A;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.schedule-card-slot.practical .slot-subject {
  color: #166534;
}

.slot-meta {
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.76rem;
  line-height: 1.35;
}

/* Prominent Print Buttons & Menus (100% Solid & High Contrast) */
.btn-print-solid-gold {
  background: #D97706 !important;
  background-color: #D97706 !important;
  color: #FFFFFF !important;
  border: 2px solid #FCD34D !important;
  font-weight: 900 !important;
  font-size: 0.9rem !important;
  padding: 0.45rem 1rem !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  cursor: pointer !important;
  text-decoration: none !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
  transition: all 0.2s ease !important;
}

.btn-print-solid-gold:hover {
  background: #B45309 !important;
  background-color: #B45309 !important;
  border-color: #FFFFFF !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(180, 83, 9, 0.6) !important;
}

.btn-print-solid-blue {
  background: #1D4ED8 !important;
  background-color: #1D4ED8 !important;
  color: #FFFFFF !important;
  border: 2px solid #93C5FD !important;
  font-weight: 900 !important;
  font-size: 0.92rem !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.45) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  text-decoration: none !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
  transition: all 0.2s ease !important;
}

.btn-print-solid-blue:hover {
  background: #1E40AF !important;
  background-color: #1E40AF !important;
  border-color: #FCD34D !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.6) !important;
}

.btn-print-prominent {
  background: #1D4ED8 !important;
  background-color: #1D4ED8 !important;
  color: #FFFFFF !important;
  font-weight: 900;
  font-size: 0.92rem;
  padding: 0.5rem 1.25rem;
  border: 2px solid #93C5FD;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.45);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-print-prominent:hover {
  background: #1E40AF !important;
  border-color: #F59E0B;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.6);
}

.btn-print-gold {
  background: #D97706 !important;
  background-color: #D97706 !important;
  color: #FFFFFF !important;
  font-weight: 900 !important;
  border: 2px solid #FCD34D !important;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45) !important;
  transition: all 0.2s ease !important;
  text-decoration: none;
}

.btn-print-gold:hover {
  background: #B45309 !important;
  color: #FFF !important;
  transform: translateY(-1px);
}

.btn-print-stage {
  background: #059669 !important;
  background-color: #059669 !important;
  color: #FFFFFF !important;
  font-weight: 900;
  font-size: 0.88rem;
  padding: 0.45rem 1rem;
  border: 2px solid #A7F3D0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.4);
  text-decoration: none;
}

.btn-print-stage:hover {
  background: #047857 !important;
  border-color: #FFFFFF;
  transform: translateY(-1px);
}

.schedule-print-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  background: #FFFFFF;
  border: 1.5px solid #1E40AF;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  min-width: 270px;
  padding: 0.4rem 0;
  text-align: right;
}

.schedule-print-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  color: var(--color-navy-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s ease;
}

.schedule-print-menu a:hover {
  background: #EFF6FF;
  color: #2563EB;
}

.schedule-scroll-hint {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #2563EB;
  background: #EFF6FF;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  border: 1px solid #BFDBFE;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .schedule-scroll-hint {
    display: flex;
  }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 44, 0.8);
  backdrop-filter: blur(5px);
  display: none;
  z-index: 1000;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-backdrop.open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.modal-dialog {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--color-border);
  position: relative;
  max-height: calc(92vh - 2rem);
  overflow: hidden;
}

.modal-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
  gap: 1rem;
  z-index: 2;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--color-danger-text);
  background: var(--color-danger-bg);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold-primary) #F1F5F9;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #F1F5F9;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--color-gold-primary);
  border-radius: 4px;
}

.modal-footer {
  padding: 1.1rem 1.5rem;
  border-top: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  background: #F1F5F9;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
  z-index: 2;
}

/* Footer */
.app-footer {
  background: var(--color-navy-primary);
  color: #94A3B8;
  padding: 1.5rem;
  font-size: 0.85rem;
  text-align: center;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ==========================================================================
   الطباعة الرسمية المخصصة (A4 Official Print Setup)
   ========================================================================== */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #FFF !important;
    color: #000 !important;
    font-size: 11pt !important;
  }

  .top-navbar,
  .sub-header,
  .btn,
  .no-print,
  .modal-backdrop,
  .app-footer {
    display: none !important;
  }

  .main-wrapper {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  .print-header {
    display: block !important;
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }

  .table {
    border: 1px solid #000 !important;
    width: 100% !important;
  }

  .table th, .table td {
    border: 1px solid #000 !important;
    color: #000 !important;
    padding: 6px 8px !important;
  }

  .table th {
    background-color: #EEE !important;
  }

  .print-footer-signatures {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    margin-top: 40px !important;
    text-align: center !important;
    page-break-inside: avoid !important;
  }

  .signature-box {
    padding: 10px;
  }

  .signature-line {
    margin-top: 45px;
    border-top: 1px dashed #000;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
  }
}
