@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #cf850e;
  --primary-dark: #b36f08;
  --primary-soft: #fff3da;
  --accent: #eea73a;
  --danger: #ef4444;

  --text-main: #0f172a;
  --text-soft: #64748b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --radius-lg: 1.25rem;
  --radius-md: 1rem;
  --shadow-soft: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-premium: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background: #f8fafc;
  color: var(--text-main);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Top Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1rem;
  gap: 1rem;
}

/* شعار المنصة + شعاري جسور والمجلس */
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo-main {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7ea, #ffe4b5);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.logo-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #ffe6b3 0, var(--primary) 45%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  box-shadow: 0 8px 18px rgba(207, 133, 14, .4);
}

.logo-text-title {
  font-weight: 800;
  font-size: 1rem;
  color: #4b3b1c;
}

.logo-text-sub {
  font-size: .8rem;
  color: var(--text-soft);
}

.partners-logos {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.partner-pill {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(227, 215, 192, 0.8);
  font-size: .78rem;
  color: #5d4a25;
}

.partner-pill img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  object-fit: cover;
  background: #f3f4f6;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .9rem;
}

.pill {
  padding: .1rem .7rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: .75rem;
  border: 1px solid rgba(239, 200, 138, 0.9);
}

.btn-outline {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: .35rem .9rem;
  background: #fff;
  cursor: pointer;
  font-size: .85rem;
}

.btn-logout {
  border-radius: 999px;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: .35rem .9rem;
  background: #fef2f2;
  cursor: pointer;
  font-size: .85rem;
}

/* ===== Layout عام ===== */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.7rem 1rem 2.5rem;
}

.hidden {
  display: none !important;
}

/* ===== Splash Screen ===== */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s;
}

#splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  animation: splashIn 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.splash-logo {
  width: 120px;
  height: 120px;
  background: #fff;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
  animation: pulse 2s infinite;
  overflow: hidden;
  border: 3px solid var(--primary);
}

.splash-logo img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.splash-title {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 2rem;
  background: linear-gradient(90deg, #fff, var(--primary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-loader {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.splash-loader::after {
  content: "";
  position: absolute;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary);
  animation: loadProgress 2s infinite;
}

@keyframes splashIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes loadProgress {
  to {
    left: 100%;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
  }

  50% {
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.7);
  }

  100% {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
  }
}

/* ===== Landing / Login View ===== */
#view-landing {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
  min-height: 80vh;
}

@media (max-width: 1024px) {
  #view-landing {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .login-card {
    order: -1;
  }
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: .6rem;
  color: #3b2c11;
}

.hero-highlight {
  color: var(--primary-dark);
  position: relative;
}

.hero-highlight::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(207, 133, 14, .3), rgba(238, 167, 58, .1));
  z-index: -1;
}

.hero-text {
  color: var(--text-soft);
  margin-bottom: 1.5rem;
  line-height: 1.8;
  max-width: 580px;
  font-size: .96rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.hero-badge {
  font-size: .8rem;
  background: #fff;
  border-radius: 999px;
  padding: .25rem .7rem;
  border: 1px solid rgba(231, 220, 198, 0.9);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: #5b4631;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(238, 167, 58, .35);
}

.hero-stats {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--text-soft);
  margin-top: .5rem;
}

.hero-stat-number {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary-dark);
  display: block;
}

.hero-tagline {
  font-size: .9rem;
  color: #7b6a45;
  margin-top: .4rem;
}

/* Login card */
.login-card {
  background: radial-gradient(circle at top, #fff7e9 0, #ffffff 48%, #fdf5e5 100%);
  border-radius: 1.3rem;
  box-shadow: var(--shadow-soft);
  padding: 1.7rem 1.6rem 1.6rem;
  border: 1px solid rgba(239, 210, 157, 0.8);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(238, 167, 58, .4), rgba(255, 255, 255, 0));
  right: -70px;
  top: -50px;
  opacity: .7;
}

.login-card-inner {
  position: relative;
  z-index: 1;
}

.login-title {
  margin: 0 0 .3rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #4a3412;
}

.login-sub {
  margin: 0 0 1.1rem;
  font-size: .85rem;
  color: var(--text-soft);
}

.tabs {
  display: flex;
  border-radius: 999px;
  background: rgba(249, 250, 251, .85);
  padding: .2rem;
  margin-bottom: 1rem;
  gap: .2rem;
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: .45rem .2rem;
  font-size: .8rem;
  cursor: pointer;
  color: var(--text-soft);
}

.tab-btn.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(207, 133, 14, 0.28);
  border: 1px solid rgba(239, 200, 138, 0.8);
}

form.login-form {
  display: none;
  margin-top: .5rem;
}

form.login-form.active {
  display: block;
}

label {
  display: block;
  font-size: .8rem;
  margin: .55rem 0 .2rem;
  color: #5a4a2c;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: .55rem .6rem;
  border-radius: .9rem;
  border: 1px solid rgba(229, 231, 235, 0.9);
  font-size: .85rem;
  background: rgba(255, 255, 255, 0.95);
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(238, 167, 58, .35);
}

.btn-primary {
  margin-top: 1rem;
  width: 100%;
  padding: .8rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: .95rem;
  box-shadow: 0 10px 25px rgba(207, 133, 14, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px rgba(207, 133, 14, 0.5);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.login-note {
  margin-top: .6rem;
  font-size: .8rem;
  color: var(--text-soft);
  text-align: center;
}

.error-msg {
  font-size: .8rem;
  color: var(--danger);
  margin-bottom: .5rem;
  text-align: center;
}

/* ===== Dashboard Layout ===== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.4rem;
  margin-top: 1.2rem;
}

.sidebar {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem 1rem;
  height: fit-content;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-header {
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-soft);
  text-transform: uppercase;
}

.sidebar-item {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-soft);
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  background: var(--bg);
  color: var(--text-main);
}

.sidebar-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 15px -3px rgba(207, 133, 14, 0.3);
}

.sidebar-tag {
  font-size: .7rem;
  background: #f9fafb;
  padding: .05rem .45rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  align-items: center;
}

.dash-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #4a3412;
}

.dash-sub {
  font-size: .86rem;
  color: var(--text-soft);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .75rem;
}

.pill-row span {
  padding: .2rem .6rem;
  border-radius: 999px;
  background: #fff7e9;
  color: #7a5721;
  border: 1px solid rgba(239, 210, 157, 0.8);
}

/* Cards / Stats */
.cards-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: .9rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1e3c8;
}

.stat-label {
  font-size: .8rem;
  color: var(--text-soft);
  margin-bottom: .2rem;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: .15rem;
  color: #4b3410;
}

.stat-foot {
  font-size: .76rem;
  color: #16a34a;
}

/* Student Card */
.student-card {
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.2) 0%, transparent 70%),
    linear-gradient(135deg, #cf850e 0%, #b36f08 100%);
  color: #fff;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(207, 133, 14, 0.5);
  max-width: 430px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
}

.student-card::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.15), transparent);
  right: -100px;
  bottom: -100px;
  pointer-events: none;
}

.student-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 86c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm66-3c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-46-43c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm13-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM58 89c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM45 66c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM11 26c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm18 34c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm23-40c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-3-24c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm26 3c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-1 30c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-35-1c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-5 58c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm38 20c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM44 4c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm25 1c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm21 21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM100 92c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-1 27c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM8 29c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm7 55c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM89 8c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM9 10c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm69 51c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-33 0c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm23-56c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-38 12c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm34 39c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-17 38c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM47 82c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm37 12c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-46-17c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm8 10c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm37-42c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm16 17c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM50 3c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm17 16c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM9 26c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm90 31c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM20 72c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM95 67c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM43 71c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM63 81c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM14 44c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm28 26c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm37-35c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM40 10c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm41 20c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM52 1c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm2-1c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm54 96c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM40 82c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm6 80c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm15-46c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm31 2c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-73 27c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm86-10c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-7-57c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-21-22c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM17 16c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm82 5c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-82-4c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm81 1c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-2 94c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-44-71c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-7-12c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-8 10c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 9c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-3-2c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM97 10c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-12 5c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-5 2c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
}

.student-card-inner {
  position: relative;
  z-index: 1;
}

.student-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .7rem;
  gap: .6rem;
}

.student-card-title {
  font-size: 1rem;
  font-weight: 800;
}

.student-card-badge {
  font-size: .7rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 244, 214, 0.8);
}

.student-card-name {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: .1rem;
}

.student-card-meta {
  font-size: .8rem;
  opacity: .95;
}

.student-card-footer {
  margin-top: .8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: .5rem;
}

.student-card-field {
  font-size: .78rem;
  opacity: .96;
}

.student-card-qr {
  width: 72px;
  height: 72px;
  border-radius: .8rem;
  background: #fefdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  color: #3f2f0f;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.student-logos-strip {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .6rem;
  font-size: .65rem;
  opacity: .95;
}

.student-logos-strip img {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  object-fit: cover;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .5);
}

/* Section Card */
.section-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid #f0e1c3;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
  gap: .5rem;
}

.section-title {
  font-size: .96rem;
  font-weight: 700;
  color: #4b3410;
}

.section-sub {
  font-size: .8rem;
  color: var(--text-soft);
}

.btn-sm {
  font-size: .75rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fdfaf4;
  cursor: pointer;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

th,
td {
  padding: .45rem .4rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

th {
  background: #fdf7ec;
  color: #7a5d29;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

/* Merchant styles */
.input-inline {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .7rem;
}

.input-inline input {
  flex: 1;
  min-width: 140px;
}

.qr-area {
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  padding: 1rem;
  text-align: center;
  font-size: .8rem;
  color: var(--text-soft);
  margin-bottom: .7rem;
  background: #fffdf7;
}

/* بطاقة ملف المحل (لوجو + بيانات) */
.merchant-profile-card {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: #fffaf0;
  border-radius: .9rem;
  padding: .6rem .7rem;
  border: 1px solid rgba(239, 210, 157, 0.8);
  margin-bottom: .6rem;
  font-size: .8rem;
}

.merchant-logo {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(207, 133, 14, 0.35);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.merchant-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merchant-profile-info {
  flex: 1;
}

.merchant-profile-name {
  font-weight: 700;
  color: #5b4017;
}

.merchant-profile-meta {
  color: var(--text-soft);
  font-size: .78rem;
}

.merchant-profile-actions {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.btn-xs {
  font-size: .7rem;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
}

/* Admin tabs */
.admin-tabs {
  display: inline-flex;
  gap: .3rem;
  background: #f6f2ea;
  border-radius: 999px;
  padding: .2rem;
  margin-bottom: .7rem;
  font-size: .8rem;
}

.admin-tab-btn {
  border: none;
  border-radius: 999px;
  padding: .25rem .7rem;
  background: transparent;
  cursor: pointer;
  color: var(--text-soft);
}

.admin-tab-btn.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(207, 133, 14, 0.2);
}

/* ===== Fullscreen Card Overlay ===== */
.card-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.card-fullscreen {
  max-width: 420px;
  width: 90%;
}

.card-fullscreen-inner {
  position: relative;
}

.fullscreen-close-btn {
  position: absolute;
  top: -42px;
  left: 0;
  background: #f9fafb;
  color: #111827;
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: .8rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.fullscreen-helper {
  position: absolute;
  top: -42px;
  right: 0;
  color: #f9fafb;
  font-size: .78rem;
  opacity: .9;
}

.fullscreen-helper span {
  opacity: .8;
}

.btn-secondary {
  margin-top: .6rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 210, 157, 0.9);
  background: #fff7e9;
  color: #7a5a23;
  padding: .4rem .8rem;
  font-size: .78rem;
  cursor: pointer;
}

/* ===== حركات بسيطة ===== */
.stat-card,
.section-card,
.student-card,
.merchant-profile-card {
  transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover,
.section-card:hover,
.merchant-profile-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.student-card:hover {
  transform: translateY(-2px) scale(1.01);
}

/* ===== ريسبونسيف ===== */

/* تابلت (1024px وأقل) */
@media (max-width: 1024px) {
  .page {
    padding: 1.2rem .9rem 2rem;
  }

  .navbar-inner {
    padding: .6rem .9rem;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .hero-text {
    font-size: .9rem;
  }

  .login-card {
    padding: 1.4rem 1.2rem 1.4rem;
  }

  .dashboard-layout {
    gap: 1rem;
  }

  .sidebar {
    padding: .8rem;
  }
}

/* تابلت/موبايل أفقي (768px وأقل) */
@media (max-width: 768px) {
  .navbar-inner {
    flex-wrap: wrap;
    gap: .6rem .9rem;
  }

  .brand-wrap {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .nav-right {
    width: 100%;
    justify-content: flex-end;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .hero-stats {
    gap: 1rem;
    font-size: .8rem;
  }

  .cards-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-card {
    max-width: 100%;
  }

  .dashboard-layout {
    margin-top: 1rem;
  }
}

/* موبايل (640px وأقل) */
@media (max-width: 640px) {
  .navbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-wrap {
    justify-content: flex-start;
  }

  .nav-right {
    justify-content: space-between;
  }

  .page {
    padding: 1rem .7rem 1.6rem;
  }

  #view-landing {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    min-height: auto;
  }

  .hero-title {
    font-size: 1.45rem;
    line-height: 1.5;
  }

  .hero-text {
    font-size: .86rem;
  }

  .hero-badges {
    gap: .4rem;
  }

  .hero-badge {
    font-size: .78rem;
    padding: .2rem .6rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: .4rem;
  }

  .login-card {
    margin-top: .5rem;
    border-radius: 1.1rem;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .dashboard-main {
    order: 1;
  }

  .dash-header {
    align-items: flex-start;
  }

  .dash-title {
    font-size: 1.1rem;
  }

  .dash-sub {
    font-size: .8rem;
  }

  .cards-row {
    grid-template-columns: 1fr;
  }

  .section-card {
    padding: .8rem;
  }

  th,
  td {
    padding: .35rem .3rem;
    font-size: .76rem;
  }

  .btn-sm,
  .btn-outline,
  .btn-secondary {
    font-size: .75rem;
    padding: .3rem .6rem;
  }

  .btn-primary {
    padding: .65rem;
    font-size: .86rem;
  }

  .student-card {
    padding: 1.1rem 1.1rem;
  }

  .student-card-name {
    font-size: 1rem;
  }

  .student-card-qr {
    width: 64px;
    height: 64px;
  }

  .btn-secondary {
    width: 100%;
    text-align: center;
    margin-top: .5rem;
  }

  /* Improved Mobile UI for Admin */
  .dashboard-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    overflow-x: hidden;
  }

  .admin-section {
    padding: 0.5rem 0.1rem;
    width: 100%;
    overflow-x: hidden;
  }

  .page {
    overflow-x: hidden;
    width: 100%;
    padding: 1rem 0.6rem 90px !important;
  }

  /* Table to Cards for Mobile */
  @media (max-width: 768px) {
    .sidebar {
      display: none !important;
    }

    .section-card table,
    .section-card thead,
    .section-card tbody,
    .section-card th,
    .section-card td,
    .section-card tr {
      display: block;
    }

    .section-card thead tr {
      position: absolute;
      top: -9999px;
      left: -9999px;
    }

    .section-card tr {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      margin-bottom: 1rem;
      padding: 1rem;
      box-shadow: var(--shadow-soft);
    }

    .section-card td {
      border: none;
      position: relative;
      padding-right: 48% !important;
      text-align: left !important;
      white-space: normal;
      min-height: 2.2rem;
      border-bottom: 1px solid #f8fafc;
      padding-top: 0.6rem;
      padding-bottom: 0.6rem;
    }

    .section-card td:last-child {
      border-bottom: none;
    }

    .section-card td:before {
      content: attr(data-label);
      position: absolute;
      right: 0.5rem;
      width: 45%;
      font-weight: 800;
      color: var(--text-soft);
      text-align: right;
      font-size: 0.75rem;
    }
  }

  /* Floating Quick Action Button */
  .fab-container {
    position: fixed;
    bottom: 85px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
  }

  .fab {
    width: 58px;
    height: 58px;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(207, 133, 14, 0.4);
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #fff;
  }

  .fab:hover {
    transform: scale(1.1) rotate(5deg);
  }

  .mobile-only {
    display: none;
  }

  @media (max-width: 768px) {
    .mobile-only {
      display: flex;
    }
  }
}

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border);
    height: 65px;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.05);
  }
}

/* Footer Credits Styling */
.footer-credits {
  margin-top: 3rem;
  padding: 2rem 1rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: #fff;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.footer-credits strong {
  color: var(--primary-dark);
  font-weight: 700;
}