:root {
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --bg-page: #f3f6fb;
  --bg-sidebar: #0f172a;
  --bg-sidebar-2: #111827;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #e2e8f0;
  --border: #e2e8f0;
  --radius-md: 12px;
  --radius-lg: 14px;
  --shadow-sm: 0 6px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 16px 36px rgba(15, 23, 42, 0.08);
}

* {
  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-primary);
  font-size: 15px;
  line-height: 1.6;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 268px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--bg-sidebar) 0%, var(--bg-sidebar-2) 100%);
  color: var(--text-inverse);
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1040;
}

.admin-sidebar__brand {
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32);
}

.admin-sidebar__close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

.admin-sidebar__menu {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #cbd5e1;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.menu-link i {
  width: 18px;
  text-align: center;
}

.menu-link:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.16);
  transform: translateX(2px);
}

.menu-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(59, 130, 246, 0.72));
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}

/* Main */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.admin-topbar__left,
.admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-page-title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.menu-toggle,
.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.menu-toggle:hover,
.icon-btn:hover {
  color: var(--primary);
  border-color: #bfd3fb;
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  position: relative;
}

.notify-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  position: absolute;
  right: 10px;
  top: 10px;
  border: 2px solid #fff;
}

.profile-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px 4px 5px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.profile-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.75rem;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.topbar-dropdown {
  border-radius: 12px;
  border-color: var(--border);
  min-width: 260px;
}

.dropdown-head {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-content {
  padding: 22px;
}

.summary-section {
  margin-bottom: 20px;
}

.metric-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 16px;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.11);
}

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

.metric-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.metric-card h3 {
  margin: 5px 0 4px;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.trend {
  font-size: 0.8rem;
  font-weight: 600;
}

.trend--up {
  color: #16a34a;
}

.trend--down {
  color: #dc2626;
}

.panel-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
  transition: box-shadow 0.25s ease;
}

.panel-card:hover {
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.11);
}

.panel-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-card__head h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.panel-card__link {
  text-decoration: none;
  color: var(--primary-600);
  font-size: 0.9rem;
  font-weight: 600;
}

.panel-card__link:hover {
  text-decoration: underline;
}

.chart-placeholder {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  min-height: 320px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.06) 0%, rgba(37, 99, 235, 0.01) 100%),
    #f8fbff;
}

.chart-placeholder__grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(148, 163, 184, 0.17) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.17) 1px, transparent 1px);
  background-size: 52px 52px;
}

.chart-placeholder__line {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 18%;
  height: 44%;
  border-radius: 200px 200px 12px 12px;
  border: 3px solid transparent;
  border-top-color: #3b82f6;
  border-right-color: #3b82f6;
  transform: skewX(-18deg);
  opacity: 0.7;
}

.chart-placeholder__note {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-size: 0.83rem;
  color: var(--text-muted);
  font-weight: 600;
}

.activity-table thead th {
  border-bottom-width: 1px;
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
}

.activity-table tbody td {
  color: var(--text-secondary);
  border-color: #edf2f7;
  font-size: 0.93rem;
}

.activity-table tbody tr:hover td {
  background: #f8fbff;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: all 0.24s ease;
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 0 22px 40px rgba(2, 6, 23, 0.42);
  }

  body.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }

  .admin-content {
    padding: 16px 14px;
  }

  .admin-topbar {
    padding: 0 12px;
  }
}
