/* ====== CloudBase — Admin Panel Design System ====== */
/* ====== Plus Jakarta Sans (headings) + DM Sans (body) ====== */

/* ——— Reset ——— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 0.9375rem; line-height: 1.6; color: var(--dark); background: var(--bg); min-height: 100vh; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.25s; }
a:hover { color: #4f46e5; }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }

/* ——— Custom Properties ——— */
:root {
  --dark: #0F172A;
  --primary: #6366F1;
  --purple: #8B5CF6;
  --success: #22C55E;
  --gray: #64748B;
  --bg: #F8FAFC;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --primary-light: rgba(99, 102, 241, 0.1);
  --success-light: rgba(34, 197, 94, 0.1);
  --purple-light: rgba(139, 92, 246, 0.1);
  --dark-light: #1E293B;
  --gray-light: #94A3B8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 68px;
}

/* ——— Container ——— */
.container { max-width: 1220px; margin: 0 auto; padding: 0 24px; }

/* ——— Typography ——— */
h1, h2, h3, h4, h5, h6 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; line-height: 1.25; color: var(--dark); }
h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 800; }
h2 { font-size: clamp(1.375rem, 2.5vw, 1.75rem); font-weight: 700; }
h3 { font-size: clamp(1.125rem, 2vw, 1.375rem); font-weight: 600; }
h4 { font-size: 1.0625rem; font-weight: 600; }
p { margin-bottom: 0.75rem; color: var(--gray); }
p:last-child { margin-bottom: 0; }
.font-mono { font-family: 'DM Sans', monospace; letter-spacing: -0.01em; }

/* ——— Header ——— */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  box-shadow: var(--shadow-sm);
}
.header .container {
  display: flex;
  align-items: center;
  height: 100%;
}
.header nav {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}

/* ——— Nav Logo ——— */
.nav-logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--primary); }
.nav-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 8px;
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
}

/* ——— Nav Links ——— */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 24px;
  flex: 1;
}
.nav-link {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--gray);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* ——— Nav CTA (right side) ——— */
.nav-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ——— Header Search ——— */
.header-search {
  position: relative;
  width: 220px;
}
.header-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg);
  font-size: 0.8125rem;
  color: var(--dark);
  outline: none;
  transition: var(--transition);
}
.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: var(--white);
}
.header-search input::placeholder { color: var(--gray-light); }
.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-light);
  font-size: 0.8125rem;
  pointer-events: none;
}

/* ——— User Dropdown ——— */
.user-dropdown {
  position: relative;
  cursor: pointer;
}
.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.user-dropdown-trigger:hover { background: var(--bg); }
.user-dropdown-trigger .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.user-dropdown-trigger .user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--dark);
}
.user-dropdown-trigger .dropdown-arrow {
  font-size: 0.625rem;
  color: var(--gray-light);
  transition: var(--transition);
}
.user-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: var(--transition);
  z-index: 100;
  overflow: hidden;
}
.user-dropdown.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  color: var(--gray);
  transition: var(--transition);
}
.user-dropdown-menu a:hover {
  background: var(--bg);
  color: var(--dark);
}
.user-dropdown-menu .dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ——— Nav Toggle (mobile) ——— */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  margin-left: auto;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ——— Page Hero ——— */
.page-hero {
  padding: 32px 0 24px;
}
.page-hero .page-title {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}
.page-hero .page-subtitle {
  font-size: 0.875rem;
  color: var(--gray);
}

/* ——— Section ——— */
.section { padding: 32px 0; }
.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.section-sub {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-bottom: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header .section-title { margin-bottom: 0; }
.section-header .section-sub { margin-bottom: 0; }

/* ——— KPI Grid ——— */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: transparent;
  transform: translateY(-2px);
}
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.kpi-icon--primary { background: var(--primary-light); color: var(--primary); }
.kpi-icon--success { background: var(--success-light); color: var(--success); }
.kpi-icon--purple { background: var(--purple-light); color: var(--purple); }
.kpi-icon--dark { background: rgba(15, 23, 42, 0.08); color: var(--dark); }
.kpi-body { flex: 1; min-width: 0; }
.kpi-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
}
.kpi-label {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-top: 2px;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 100px;
}
.kpi-trend--up { background: var(--success-light); color: var(--success); }
.kpi-trend--down { background: rgba(239, 68, 68, 0.1); color: #EF4444; }

/* ——— Card ——— */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
}

/* ——— Table Responsive ——— */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table { width: 100%; min-width: 600px; }
.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge--active { background: var(--success-light); color: var(--success); }
.status-badge--pending { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.status-badge--completed { background: var(--primary-light); color: var(--primary); }
.status-badge--cancelled { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.data-table .project-name {
  font-weight: 600;
  color: var(--dark);
}
.data-table .project-client {
  font-size: 0.8125rem;
  color: var(--gray);
}
.data-table .progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.data-table .progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  max-width: 120px;
}
.data-table .progress-bar .progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width 0.6s ease;
}
.data-table .progress-bar .progress-fill--success { background: var(--success); }
.data-table .progress-bar .progress-fill--purple { background: var(--purple); }
.data-table .progress-text { font-size: 0.75rem; font-weight: 600; color: var(--gray); min-width: 36px; }

/* ——— Activity Feed ——— */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-dot--primary { background: var(--primary); }
.activity-dot--success { background: var(--success); }
.activity-dot--purple { background: var(--purple); }
.activity-dot--warning { background: #F59E0B; }
.activity-content { flex: 1; min-width: 0; }
.activity-text {
  font-size: 0.875rem;
  color: var(--dark);
  line-height: 1.5;
}
.activity-text strong { font-weight: 600; }
.activity-time {
  font-size: 0.75rem;
  color: var(--gray-light);
  margin-top: 2px;
}

/* ——— Project Card ——— */
.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: transparent;
  transform: translateY(-2px);
}
.project-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.project-card-body { padding: 16px 20px; }
.project-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.project-card-client {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-bottom: 12px;
}
.project-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 12px;
}
.project-card-meta span { display: flex; align-items: center; gap: 4px; }
.project-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-card-avatars {
  display: flex;
}
.project-card-avatars img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--white);
  margin-right: -8px;
}
.project-card-avatars span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  margin-right: -8px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ——— Team Card ——— */
.team-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
  transition: var(--transition);
  padding: 32px 20px 24px;
}
.team-card:hover {
  box-shadow: var(--shadow-md);
  border-color: transparent;
  transform: translateY(-2px);
}
.team-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
}
.team-card-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 2px;
}
.team-card-role {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-bottom: 12px;
}
.team-card-skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}
.team-card-skills span {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--bg);
  color: var(--gray);
  border: 1px solid var(--border);
}
.team-card-social {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.team-card-social a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: var(--bg);
  color: var(--gray);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.team-card-social a:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background: #4f46e5; color: var(--white); }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--gray);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}
.btn-ghost {
  background: transparent;
  color: var(--gray);
}
.btn-ghost:hover { background: var(--bg); color: var(--dark); }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ——— Chart (inline SVG / CSS bars) ——— */
.chart-inline {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding: 0 4px;
}
.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--primary), var(--purple));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.6s ease;
  position: relative;
}
.chart-bar:hover { opacity: 0.8; }
.chart-bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem;
  color: var(--gray);
  white-space: nowrap;
}

/* ——— Analytics Grid ——— */
.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
.analytics-full { grid-column: 1 / -1; }

/* ——— Form Styles ——— */
.form { max-width: 720px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}
.form-label .required { color: #EF4444; margin-left: 2px; }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.875rem;
  color: var(--dark);
  outline: none;
  transition: var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-input::placeholder { color: var(--gray-light); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%2364748B'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-hint {
  font-size: 0.75rem;
  color: var(--gray-light);
  margin-top: 4px;
}
.form-ok, .form-err {
  display: none;
  font-size: 0.8125rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.form-ok.show, .form-err.show { display: block; }
.form-ok { background: var(--success-light); color: var(--success); }
.form-err { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}

/* ——— Settings Page ——— */
.settings-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  overflow: hidden;
}
.settings-section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.settings-section-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}
.settings-section-header p {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-top: 2px;
}
.settings-section-body { padding: 24px; }

/* ——— Toggle Switch ——— */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-track { background: var(--primary); }
.toggle-switch input:checked + .toggle-track::after { left: 20px; }
.toggle-label { font-size: 0.875rem; color: var(--dark); }
.toggle-desc { font-size: 0.75rem; color: var(--gray); }

/* ——— Footer ——— */
.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.footer h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dark);
  margin-bottom: 12px;
}
.footer p, .footer a, .footer span { font-size: 0.8125rem; color: var(--gray); line-height: 2; }
.footer a:hover { color: var(--primary); }
.footer .brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--dark);
  margin-bottom: 8px;
  display: block;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--gray);
}

/* ——— Back to Top ——— */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
  z-index: 900;
  border: none;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover { background: #4f46e5; color: var(--white); }

/* ——— Scroll Reveal ——— */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }
.reveal.d4 { transition-delay: 0.4s; }

/* ——— 404 Page ——— */
.page-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 60px 24px;
}
.page-404 .error-code {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(5rem, 12vw, 8rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}
.page-404 h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.page-404 p {
  font-size: 0.9375rem;
  color: var(--gray);
  max-width: 400px;
  margin-bottom: 24px;
}

/* ——— Quick Stats / Dashboard metrics ——— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.stat-item {
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.stat-item .stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--dark);
}
.stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 2px;
}
.stat-item .stat-change {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: 4px;
}
.stat-change--up { color: var(--success); }
.stat-change--down { color: #EF4444; }

/* ——— Dashboard page specific ——— */
.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ——— Empty state ——— */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}
.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.0625rem;
  margin-bottom: 4px;
}
.empty-state p {
  font-size: 0.8125rem;
  color: var(--gray);
  max-width: 300px;
  margin: 0 auto;
}

/* ——— Responsive ——— */
@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .dashboard-metrics-grid { grid-template-columns: 1fr; }
  .header-search { width: 160px; }
}

@media (max-width: 768px) {
  .header-search { display: none; }
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    margin-left: 0;
    z-index: 999;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav-link { width: 100%; padding: 12px 16px; }
  .nav-toggle { display: flex; }
  .nav-cta { gap: 8px; }
  .user-dropdown-trigger .user-name { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .page-hero { padding: 24px 0 16px; }
  .section { padding: 24px 0; }
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
  .stats-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}

@media (max-width: 480px) {
  .kpi-card { padding: 16px; }
  .card-body { padding: 16px; }
  .settings-section-body { padding: 16px; }
  .settings-section-header { padding: 16px; }
}

/* ——— prefers-reduced-motion ——— */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .kpi-card:hover, .project-card:hover, .team-card:hover { transform: none; }
  .back-to-top { transition: none; }
  .nav-links, .user-dropdown-menu { transition: none; }
}