:root {
  --purple: #6a3b8b;
  --purple-dark: #552e70;
  --purple-deep: #4a2766;
  --purple-soft: #f3eaf8;
  --purple-mid: #8a5aa8;
  --bg: #efeaf4;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --line: #e7e9ee;
  --sidebar: #5b2f78;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(42, 24, 61, 0.06);
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--sidebar), var(--purple-deep));
  color: #fff;
  padding: 20px 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 28px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .brand-logo {
  width: 72%;
  max-width: 158px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.sidebar .brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
}

.sidebar .brand-crm {
  display: block;
  width: 100%;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: #d7c4e8;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.sidebar .brand-sub {
  display: block;
  width: 100%;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  line-height: 1.4;
}

.sidebar nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  color: #f5eef9;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-version {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #f3e9fa;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.topbar .title {
  font-weight: 800;
  color: var(--purple-deep);
}

.content {
  padding: 22px;
}

.card-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card-panel h1,
.card-panel h2 {
  margin: 0 0 10px;
  color: var(--purple-deep);
}

.muted { color: var(--muted); }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.metric {
  background: linear-gradient(180deg, #fbf8fd, #fff);
  border: 1px solid #e4d7ef;
  border-radius: 12px;
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 22px;
  color: var(--purple-deep);
}

.chip {
  display: inline-block;
  background: var(--purple-soft);
  color: var(--purple-dark);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  margin: 2px;
}

.btn-ju {
  display: inline-block;
  background: var(--purple);
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 700;
}

.btn-ju:hover { background: var(--purple-dark); }

.table-ju {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-ju th,
.table-ju td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: right;
}

.table-ju th {
  color: var(--muted);
  background: #faf7fc;
}

.auth-links a {
  margin-inline-start: 10px;
  color: var(--purple-dark);
  font-weight: 700;
}

.footer-bar {
  margin-top: auto;
  padding: 16px 22px 20px;
  background: linear-gradient(180deg, transparent, rgba(106, 59, 139, 0.06));
  border-top: 1px solid var(--line);
}

.footer-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  text-align: center;
}

.footer-year {
  font-weight: 800;
  font-size: 14px;
  color: var(--purple-deep);
  letter-spacing: 0.2px;
}

.footer-sep {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-mid);
  opacity: 0.85;
  flex-shrink: 0;
}

.footer-deanship {
  font-weight: 600;
  font-size: 13px;
  color: var(--purple-dark);
}

/* Home quick navigation */
.home-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 90% at 100% 0%, rgba(138, 90, 168, 0.12), transparent 55%),
    linear-gradient(165deg, #ffffff 0%, #faf6fc 55%, #f5eef9 100%);
  border-color: #e2d4ec;
  padding: 22px 22px 20px;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--purple-mid), var(--purple-deep));
  border-radius: 0 var(--radius) var(--radius) 0;
}

.home-hero-intro {
  margin-bottom: 18px;
  max-width: 38rem;
}

.home-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--purple-mid);
}

.home-hero h1 {
  margin: 0 0 4px;
  font-size: clamp(1.55rem, 2.2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.home-lead {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
}

.home-quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

.home-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e4d7ef;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 8px 18px rgba(74, 39, 102, 0.05);
  color: var(--purple-deep);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.home-tile:hover {
  transform: translateY(-3px);
  border-color: #cbb0df;
  background: #fff;
  box-shadow: 0 14px 28px rgba(74, 39, 102, 0.12);
  color: var(--purple-deep);
}

.home-tile:focus-visible {
  outline: 2px solid var(--purple-mid);
  outline-offset: 2px;
}

.home-tile-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--purple-soft), #ebe0f4);
  color: var(--purple);
  box-shadow: inset 0 0 0 1px rgba(106, 59, 139, 0.08);
}

.home-tile-icon svg {
  width: 22px;
  height: 22px;
}

.home-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-tile-body strong {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
}

.home-tile-body small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
}

.home-tile-primary {
  background: linear-gradient(145deg, var(--purple) 0%, var(--purple-deep) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 24px rgba(74, 39, 102, 0.28);
}

.home-tile-primary:hover {
  background: linear-gradient(145deg, var(--purple-mid) 0%, var(--purple-dark) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 16px 30px rgba(74, 39, 102, 0.34);
}

.home-tile-primary .home-tile-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.home-tile-primary .home-tile-body small {
  color: rgba(255, 255, 255, 0.82);
}

.home-tile-accent {
  border-color: #d7c0e8;
  background: linear-gradient(160deg, #fbf7fd, #f3eaf8);
}

.home-tile-accent .home-tile-icon {
  background: linear-gradient(160deg, #efe3f7, #e2d0ef);
  color: var(--purple-dark);
}

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-height: auto;
  }
  .sidebar-version {
    margin-top: 14px;
  }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-sep { display: none; }
  .footer-credit { flex-direction: column; gap: 4px; }
  .home-quick-nav { grid-template-columns: 1fr 1fr; }
  .home-hero::before { display: none; }
}

@media (max-width: 560px) {
  .home-quick-nav { grid-template-columns: 1fr; }
}
