/* منصة آزر لخدمات المستفيدين - نظام التصميم الرسمي */
:root {
  --azer-blue: #1d7fe2;
  --azer-indigo: #4f56e8;
  --azer-violet: #6a44d8;
  --azer-grad: linear-gradient(135deg, #1d7fe2 0%, #5b4fe9 58%, #6a44d8 100%);
  --azer-grad-soft: linear-gradient(135deg, rgba(29,127,226,.08) 0%, rgba(106,68,216,.10) 100%);
  --bg: #f4f7fc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --success: #0f9d58;
  --success-bg: #ecfdf5;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0369a1;
  --info-bg: #f0f9ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px rgba(29, 127, 226, 0.14);
}

* { box-sizing: border-box; }

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Tajawal", "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--azer-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 18px;
}

main.page-main {
  flex: 1;
  padding: 24px 0 48px;
}

/* الشريط العلوي */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
}

.brand-logo {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 13px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.94rem;
  transition: background .15s, color .15s;
}

.nav-link:hover, .nav-link.active {
  background: var(--azer-grad-soft);
  color: var(--azer-indigo);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.notif-count {
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 999px;
  margin-right: 6px;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* البطاقات والعناصر */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
}

.hero-banner {
  background: var(--azer-grad);
  color: #fff;
  border-radius: 20px;
  padding: 34px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-banner h1, .hero-banner h2 {
  margin: 0 0 10px;
  color: #fff;
}

.hero-banner p {
  margin: 0 0 18px;
  opacity: 0.95;
  max-width: 720px;
}

/* الشبكات */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* إحصائيات */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--azer-indigo);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .1s, opacity .15s, background .15s;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--azer-grad);
  color: #fff;
}
.btn-primary:hover { opacity: 0.94; }

.btn-outline {
  background: #fff;
  color: var(--azer-indigo);
  border-color: var(--azer-indigo);
}
.btn-outline:hover { background: var(--azer-grad-soft); }

.btn-light {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.btn-light:hover { background: rgba(255,255,255,0.28); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }

/* الشارات */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: #eef2ff; color: var(--azer-indigo); }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }

/* التنبيهات */
.alert-box {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  font-weight: 600;
}
.alert-success { background: var(--success-bg); border-color: #a7f3d0; color: #065f46; }
.alert-warning { background: var(--warning-bg); border-color: #fde68a; color: #92400e; }
.alert-danger { background: var(--danger-bg); border-color: #fecaca; color: #991b1b; }
.alert-info { background: var(--info-bg); border-color: #bae6fd; color: #075985; }

/* النماذج */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.94rem;
}
.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.96rem;
  background: #fff;
  color: var(--text);
}
.form-control:focus {
  outline: none;
  border-color: var(--azer-indigo);
  box-shadow: 0 0 0 3px rgba(79, 86, 232, 0.14);
}
.form-hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* الجداول */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
table.data-table th, table.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
table.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
}

/* بطاقة الاحتياج اليومي */
.need-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.need-card:hover {
  transform: translateY(-2px);
  border-color: var(--azer-indigo);
  box-shadow: var(--shadow-lg);
}

/* خط الزمن للطلب والرحلة */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline-item {
  position: relative;
  padding: 0 28px 18px 0;
  border-right: 2px solid #cbd5e1;
}
.timeline-item:last-child { border-right-color: transparent; padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  right: -8px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #fff;
}
.timeline-item.done .timeline-dot { background: var(--success); }
.timeline-item.active .timeline-dot { background: var(--azer-indigo); box-shadow: 0 0 0 4px rgba(79,86,232,.2); }

/* بطاقة المستفيد الرقمية */
.id-card {
  max-width: 460px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.id-card-top {
  background: var(--azer-grad);
  color: #fff;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.id-card-body {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* التذييل */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* استجابة الجوال */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links {
    display: none;
    position: absolute;
    top: 74px;
    right: 0;
    left: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 18px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .mobile-menu-btn { display: inline-flex; }
}

@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .id-card-body { flex-direction: column; text-align: center; }
  .hero-banner { padding: 24px 18px; }
}

/* تنسيق الطباعة */
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .card, .id-card { box-shadow: none; border: 1px solid #cbd5e1; }
}
