:root {
  --primary: #6f42c1;
  --primary-700: #5f35aa;
  --accent: #9b6dff;
  --bg-page: #f7f4ff;
  --bg-topbar: linear-gradient(135deg, #1f1536 0%, #35205c 55%, #4d2f7f 100%);
  --bg-sidebar: #f1ebff;
  --text-900: #1e1b2e;
  --text-700: #403a57;
  --text-500: #6f668c;
  --text-inverse: #efe9ff;
  --border: #e4dcf6;
  --radius-lg: 16px;
  --radius-md: 13px;
  --shadow-sm: 0 8px 20px rgba(45, 29, 84, 0.08);
  --shadow-md: 0 16px 36px rgba(45, 29, 84, 0.14);
  --transition-fast: 0.2s ease;
  --transition-mid: 0.28s ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-900);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: var(--bg-topbar);
  border-bottom: 1px solid rgba(155, 109, 255, 0.22);
  box-shadow: 0 12px 25px rgba(31, 21, 54, 0.28);
}

.top-nav__inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav__menu-toggle {
  border: 1px solid var(--border);
  background: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text-700);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
}

.logo__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow-sm);
}

.top-nav__menu {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  scrollbar-width: thin;
}

.top-link {
  position: relative;
  text-decoration: none;
  color: var(--text-inverse);
  font-weight: 600;
  padding: 9px 13px;
  font-size: 0.84rem;
  border-radius: 10px;
  white-space: nowrap;
  transform: translateY(0);
  transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.top-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 34%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(155, 109, 255, 0), rgba(155, 109, 255, 0.9), rgba(155, 109, 255, 0));
  transform: translateX(-50%) scaleX(0.55);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.top-link:hover {
  color: #fff;
  background: rgba(155, 109, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(31, 21, 54, 0.26);
}

.top-link:hover::after {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

.top-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.95), rgba(155, 109, 255, 0.95));
  box-shadow: 0 6px 18px rgba(111, 66, 193, 0.35);
}

.top-link.is-active::after {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

.top-nav__right { margin-left: auto; }

.profile-btn {
  border: 1px solid rgba(155, 109, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  padding: 5px 11px 5px 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.profile-btn__avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.78rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.layout {
  display: flex;
  min-height: calc(100vh - 70px);
  background:
    radial-gradient(circle at 88% 8%, rgba(111, 66, 193, 0.11), transparent 32%),
    radial-gradient(circle at 8% 90%, rgba(155, 109, 255, 0.1), transparent 34%);
}

.context-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  transition: transform var(--transition-mid);
}

.context-sidebar__head h2 {
  margin: 2px 8px 14px;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-700);
}

.context-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.context-sidebar__close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-700);
}

.context-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.context-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-700);
  font-weight: 550;
  border-radius: 10px;
  padding: 10px 12px;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.context-link i { width: 18px; }

.context-link:hover {
  background: #e8defd;
  transform: translateX(2px);
}

.context-link.is-active {
  color: var(--primary-700);
  background: linear-gradient(135deg, #ebdeff, #f4eeff);
  font-weight: 600;
}

.main-content {
  flex: 1;
  padding: 34px 30px;
  min-width: 0;
}

.page-head {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.25vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 10px 0 0;
  color: var(--text-500);
  max-width: 66ch;
  font-size: 0.96rem;
}

.summary-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px 20px;
  height: 100%;
  transition: transform var(--transition-mid), box-shadow var(--transition-mid), border-color var(--transition-mid);
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(111, 66, 193, 0.08), rgba(155, 109, 255, 0.05));
  opacity: 0;
  transition: opacity var(--transition-mid);
  pointer-events: none;
}

.summary-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.summary-card p {
  margin: 0;
  color: var(--text-500);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
}

.summary-card h3 {
  margin: 7px 0 0;
  font-size: 1.78rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.summary-card:hover {
  transform: translateY(-4px);
  border-color: #d8c8f5;
  box-shadow: 0 16px 28px rgba(45, 29, 84, 0.16);
}

.summary-card:hover::before {
  opacity: 1;
}

.content-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: box-shadow var(--transition-mid), transform var(--transition-mid);
}

.content-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(111, 66, 193, 0.05), rgba(155, 109, 255, 0.03));
  opacity: 0;
  transition: opacity var(--transition-mid);
  pointer-events: none;
}

.content-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee5fb;
}

.content-card__head h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(45, 29, 84, 0.15);
}

.content-card:hover::before {
  opacity: 1;
}

.recent-table thead th {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-500);
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}

.recent-table tbody td {
  padding-top: 15px;
  padding-bottom: 15px;
  color: var(--text-700);
  border-color: #efe7fb;
  transition: background-color var(--transition-fast);
  font-size: 0.91rem;
  font-weight: 500;
}

.recent-table tbody tr:hover td { background: #faf7ff; }

.progress-sm {
  height: 8px;
  border-radius: 999px;
  background: #ece4fb;
}

.progress-sm .progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.badge-soft {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 5px 11px;
  font-weight: 700;
}

.badge-soft--primary { color: var(--primary-700); background: #eadfff; }
.badge-soft--info { color: #6d4cbc; background: #f0e8ff; }
.badge-soft--success { color: #166534; background: #dcfce7; }

.layout-overlay {
  position: fixed;
  inset: 70px 0 0 0;
  background: rgba(25, 15, 46, 0.44);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 1025;
}

@media (max-width: 991.98px) {
  .top-nav__menu { display: none; }
  .context-sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    width: 285px;
    transform: translateX(-100%);
    z-index: 1030;
    transition: transform var(--transition-mid);
    box-shadow: 0 8px 30px rgba(25, 15, 46, 0.25);
  }

  body.sidebar-open .context-sidebar { transform: translateX(0); }
  body.sidebar-open .layout-overlay { opacity: 1; visibility: visible; }
  .main-content { width: 100%; padding: 22px 14px 18px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .content-card { padding: 16px; }
}

.welcome-popup
{
	position:fixed;
	top:0;
	left:0;
	width:100%;
	height:100%;
	background:rgba(0,0,0,0.6);
	display:none;
	display:flex;
	justify-content:center;
	align-items:center;
	z-index:9999;
}

.popup-box
{
	background:#fff;
	padding:40px;
	border-radius:12px;
	width:320px;
	text-align:center;
	box-shadow:0 15px 40px rgba(0,0,0,0.2);
	animation:popup 0.4s ease;
}

@keyframes popup
{
	from
	{
		transform:scale(0.7);
		opacity:0;
	}
	to
	{
		transform:scale(1);
		opacity:1;
	}
}

.popup-box h3
{
	color:#5c050f;
	margin-bottom:10px;
}

.popup-box button
{
	margin-top:20px;
	padding:10px 25px;
	border:none;
	background:linear-gradient(135deg, var(--primary), var(--accent));
	color:white;
	border-radius:6px;
	cursor:pointer;
}