* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cairo", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-body, #f8fafc);
  color: var(--text-primary, #1e293b);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

.portal-nav {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-brand .brand-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.nav-brand span {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 7px 16px;
  border-radius: 8px;
  font-family: "Cairo", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #ef4444;
}

.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px 80px;
}

.portal-hero {
  text-align: center;
  margin-bottom: 52px;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.portal-hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.portal-hero h1 .accent {
  color: #0d9488;
}

.portal-hero p {
  font-size: 15px;
  color: #64748b;
  font-weight: 500;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  gap: 24px;
  justify-content: center;
  width: 100%;
  max-width: 800px;
  animation: fadeUp 0.6s 0.08s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.system-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.system-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 20px 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ajeer-card::after {
  background: linear-gradient(90deg, #0d9488, #14b8a6);
}

.system-card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.system-card:hover::after {
  opacity: 1;
}

.card-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 20px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.system-card:hover .card-icon-wrap {
  transform: scale(1.1) rotate(5deg);
}

.ajeer-card .card-icon-wrap {
  background: linear-gradient(135deg, #ccfbf1, #99f6e4);
  color: #0d9488;
}

.card-title {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.75;
  margin-bottom: 24px;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0d9488;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.system-card:hover .card-cta {
  background: #0d9488;
  border-color: #0d9488;
  color: white;
  gap: 10px;
}

.portal-footer {
  margin-top: 60px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  animation: fadeUp 0.6s 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 500px) {
  .portal-nav {
    padding: 0 16px;
  }

  .user-label {
    display: none;
  }

  .portal-main {
    padding: 40px 16px 60px;
  }
}