/* Offline mode: system Arabic fonts instead of Google Fonts */

:root {
  --primary-color: #2c4bbb;
  --primary-hover: #1e3692;
  --secondary-color: #f7f9fc;
  --text-color: #333333;
  --border-color: #e1e4e8;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  --surface-color: rgba(255, 255, 255, 0.85);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

body {
  font-family: 'Segoe UI', Tahoma, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-color);
  direction: rtl;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

h1, h2, h3 {
  font-weight: 700;
  color: var(--primary-color);
}

.card {
  background: var(--surface-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

thead {
  background-color: var(--primary-color);
  color: #fff;
}

th, td {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 500;
  white-space: nowrap;
}

tbody tr {
  transition: background-color 0.2s;
}

tbody tr:hover {
  background-color: var(--secondary-color);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Segoe UI', Tahoma, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
}

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

.btn-success {
  background-color: var(--success-color);
  color: #fff;
}

.btn-success:hover {
  background-color: #218838;
}

.btn-danger {
  background-color: var(--danger-color);
  color: #fff;
}

.btn-danger:hover {
  background-color: #c82333;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: 'Segoe UI', Tahoma, 'Helvetica Neue', Arial, sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: #fff;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(44, 75, 187, 0.1);
}

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.sub-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: transparent;
  box-shadow: none;
}
.sub-table td {
  border: none;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px dotted var(--border-color);
}
.sub-table tr:last-child td {
  border-bottom: none;
}

.archived-section {
  opacity: 0.9;
}
.archived-section thead {
  background-color: #6c757d;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  transform: translateY(-20px);
  transition: transform 0.3s;
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.detail-row {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
}
