@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* === Design tokens === */
  --primary: #6B5DD3;
  --primary-hover: #5B4DC4;
  --primary-soft: #EFEAFE;
  --primary-soft-2: #DCD3FA;
  --green: #6FB89A;
  --green-soft: #DDEEE3;
  --yellow: #E8C254;
  --yellow-soft: #F8EBC4;
  --gray-soft: #E6E7EB;
  --bg: #F4F2EE;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --border: #ECEAE4;
  --text: #25242C;
  --text-muted: #7C7B85;
  --text-faint: #ACAAB3;
  --shadow-card: 0 1px 2px rgba(20, 17, 45, 0.04), 0 8px 24px rgba(20, 17, 45, 0.04);

  /* Legacy aliases — used by inline JS styles */
  --primary-color: #6B5DD3;
  --secondary-color: #6FB89A;
  --success-color: #6FB89A;
  --bg-dark: #F4F2EE;
  --bg-light: #FFFFFF;
  --text-primary: #25242C;
  --text-secondary: #7C7B85;
  --border-color: #ECEAE4;
  --surface-color: #FFFFFF;
  --card-bg: #FBFAF7;
  --accent-color: #8B7CE0;
  --shadow: var(--shadow-card);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* === BUTTONS === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  background: var(--primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--text-faint);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  background: #FEE2E2;
  color: #DC2626;
  border: 1.5px solid #FECACA;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover { background: #FECACA; }

.btn-full { width: 100%; }

/* === HERO (base, overridden per page) === */
.hero {
  background: var(--surface);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 36px;
  line-height: 1.15;
  margin-bottom: 14px;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: unset;
}

.hero p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 15px;
}

/* === CARD === */
.card {
  background: var(--surface);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-card);
}

/* === FEATURE CARD === */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  transition: all 0.15s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--primary-soft-2);
}

.feature-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--primary);
}

.feature-card p { color: var(--text-muted); font-size: 13px; }

/* === USER STATS === */
.user-stats {
  background: var(--surface);
  padding: 28px;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  margin-top: 24px;
}

.user-stats h2 { margin-bottom: 20px; font-size: 18px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stat-item {
  background: var(--surface-2);
  padding: 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border-radius: 12px;
  flex-shrink: 0;
  font-size: 20px;
}

.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; display: block; }
.stat-value { font-size: 18px; font-weight: 600; color: var(--text); display: block; }

/* === MODAL === */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(37, 36, 44, 0.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal.active { display: flex; }

.modal-content {
  background: var(--surface);
  border-radius: 24px;
  padding: 36px;
  max-width: 560px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 64px rgba(20, 17, 45, 0.18);
  animation: modalIn 0.2s ease;
}

.modal-large { max-width: 920px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 18px; right: 22px;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: color 0.15s;
  display: block;
  width: 28px; height: 28px;
  text-align: center;
}

.modal-close:hover { color: var(--text); }

/* === PROGRESS BAR === */
.progress-bar, .progress-track {
  background: var(--gray-soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.experience-bar { background: var(--gray-soft); border-radius: 999px; height: 10px; overflow: hidden; }
.experience-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.4s ease; }

/* === FORM === */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-input::placeholder { color: var(--text-faint); }

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.form-checkbox input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.form-checkbox label {
  margin: 0;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
}

/* === TABS === */
.tab-btn, .filter-btn {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.tab-btn:hover, .filter-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tab-btn.active, .filter-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-soft-2);
}

/* === NOTIFICATION === */
.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(20, 17, 45, 0.14);
  z-index: 9999;
  border-left: 4px solid var(--primary);
  max-width: 360px;
  animation: notifIn 0.2s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification-success { border-left-color: var(--green); }
.notification-error   { border-left-color: #DC2626; }
.notification-warning { border-left-color: var(--yellow); }
.notification-hiding  { opacity: 0; transform: translateX(20px); }

@keyframes notifIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* === PAGE LAYOUT (2-column: main + sidebar) === */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.page-main  { display: flex; flex-direction: column; gap: 24px; }
.page-sidebar { display: flex; flex-direction: column; gap: 24px; }

.card       { background: var(--surface); border-radius: 20px; padding: 28px; box-shadow: var(--shadow-card); }
.card-lg    { padding: 36px; }
.card-sm    { padding: 20px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-head h2 { font-size: 20px; }
.section-head h3 { font-size: 18px; }
.section-meta    { font-size: 13px; color: var(--text-muted); }
.sidebar-card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--text); }

/* Stat row inside a card */
.inline-stat { display: flex; align-items: center; gap: 12px; }
.inline-stat .stat-label { font-size: 11px; color: var(--text-muted); display: block; }
.inline-stat .stat-value { font-size: 14px; font-weight: 600; color: var(--text); display: block; }

/* Pill badge */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--primary-soft); color: var(--primary);
}
.pill-green  { background: var(--green-soft);  color: #3F8C6E; }
.pill-yellow { background: var(--yellow-soft); color: #C9A02E; }

@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
}

/* === ICON TILES === */
.tile-purple { background: var(--primary-soft); color: var(--primary); }
.tile-green  { background: var(--green-soft);   color: var(--green); }
.tile-yellow { background: var(--yellow-soft);  color: #C9A02E; }

/* === SECTION HEADINGS === */
.section-title {
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--text);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .container { padding: 16px 16px 60px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal-content { padding: 24px; border-radius: 18px; }
}