/* ==========================================================================
   Relationship CRM — matches Me & You Enterprises' course-card visual style:
   colorful rounded icon badges, pill buttons, soft-shadow white cards.
   ========================================================================== */

:root {
  --bg:        #F5F7FA;
  --card:      #FFFFFF;
  --ink:       #1E293B;
  --muted:     #64748B;
  --line:      #E7EBF0;

  --green:     #1FB374;   --green-soft:  #E4F8EE;
  --blue:      #3B6FE0;   --blue-soft:   #E8EEFD;
  --purple:    #8B5CF6;   --purple-soft: #F1EAFE;
  --orange:    #F0A93B;   --orange-soft: #FDF1DE;
  --teal:      #17A9B8;   --teal-soft:   #E2F6F8;
  --danger:    #E5484D;   --danger-soft: #FCE8E8;

  /* category -> accent mapping */
  --cat-student:  var(--blue);   --cat-student-soft:  var(--blue-soft);
  --cat-investor: var(--green);  --cat-investor-soft: var(--green-soft);
  --cat-friend:   var(--orange); --cat-friend-soft:   var(--orange-soft);
  --cat-family:   var(--purple); --cat-family-soft:   var(--purple-soft);
  --cat-other:    var(--teal);   --cat-other-soft:    var(--teal-soft);
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }
body {
  margin: 0;
  overflow-x: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
h1, h2, .brand-text { font-family: 'Poppins', 'Inter', sans-serif; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--card);
  color: var(--ink);
  padding: 14px 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  box-shadow: 0 1px 3px rgba(30, 41, 59, 0.06);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { height: 38px; display: block; flex-shrink: 0; }
.brand-text { font-weight: 700; font-size: 17px; color: var(--ink); white-space: nowrap; }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; }
.topbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.topbar a:hover { color: var(--blue); }
.topbar a[data-active="1"] { color: var(--blue); border-color: var(--blue); }

.container { max-width: 1150px; margin: 32px auto; padding: 0 20px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 2px 10px rgba(30, 41, 59, 0.05);
  min-width: 0;
}

h1 { font-size: 26px; font-weight: 700; margin: 0 0 20px; color: var(--ink); }
h2 { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0; display: flex; align-items: center; gap: 8px; }
.eyebrow {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 6px;
}

/* ---------- Tables ---------- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Badges — soft pill style like course duration tags ---------- */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.badge-student  { color: var(--cat-student);  background: var(--cat-student-soft); }
.badge-investor { color: var(--cat-investor); background: var(--cat-investor-soft); }
.badge-friend   { color: var(--cat-friend);   background: var(--cat-friend-soft); }
.badge-family   { color: var(--cat-family);   background: var(--cat-family-soft); }
.badge-other    { color: var(--cat-other);    background: var(--cat-other-soft); }

/* ---------- Buttons — rounded pills like "Learn More" ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue); color: #fff; border: none;
  padding: 11px 20px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 700; transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(0.92); }
.btn:active { transform: scale(0.98); }
.btn-secondary { background: #64748B; }
.btn-danger { background: var(--danger); }
.btn-wish { background: var(--green); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }

/* ---------- Forms ---------- */
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 14px; background: var(--card); color: var(--ink); font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 111, 224, 0.15);
}
label { display: block; font-size: 12.5px; font-weight: 700; margin: 14px 0 6px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Stat cards — colorful rounded icon badges like course cards ---------- */
.stat-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-box {
  flex: 1 1 170px; min-width: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; box-shadow: 0 2px 10px rgba(30, 41, 59, 0.05);
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center;
  justify-content: center; margin-bottom: 14px;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-box .num { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-box .label { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 18px; border-radius: 14px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.alert-success { background: var(--green-soft); color: #0F7A4C; }
.alert-error   { background: var(--danger-soft); color: #B4292D; }

/* ---------- Login ---------- */
.login-wrap { max-width: 400px; margin: 90px auto; padding: 0 16px; }
.login-wrap .card { text-align: left; }
.login-wrap .brand { justify-content: center; margin-bottom: 18px; }

/* ---------- Upcoming list items ---------- */
.upcoming-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; border-bottom: 1px solid var(--line); gap: 10px; flex-wrap: wrap;
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-item strong { font-weight: 700; }
.days-left { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.days-pill {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 11.5px;
  font-weight: 700; background: var(--orange-soft); color: #B5750E; margin-bottom: 4px;
}
.days-pill.today { background: var(--green-soft); color: #0F7A4C; }
.sent-tag { font-size: 12.5px; color: var(--green); font-weight: 700; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; }

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; flex-direction: column; align-items: flex-start; }
  .brand img { height: 30px; }
  .brand-text { font-size: 15px; }
  .nav-links { width: 100%; gap: 6px 14px; }
  .topbar a { font-size: 13px; padding: 4px 2px; }

  .container { padding: 0 14px; margin: 18px auto; }
  h1 { font-size: 21px; margin-bottom: 14px; }
  .card { padding: 16px; border-radius: 14px; }

  .grid-2 { grid-template-columns: 1fr; gap: 14px; }

  .stat-row { gap: 10px; }
  .stat-box { flex: 1 1 calc(50% - 5px); padding: 14px; border-radius: 14px; }
  .stat-box .num { font-size: 24px; }
  .stat-icon { width: 38px; height: 38px; margin-bottom: 10px; }
  .stat-icon svg { width: 18px; height: 18px; }

  .upcoming-item { padding: 12px 2px; }
  .upcoming-item > div:last-child { text-align: left !important; width: 100%; display: flex; align-items: center; gap: 10px; }

  .grid-2 .card, .card { max-width: 100%; }
}

@media (max-width: 420px) {
  .stat-box { flex: 1 1 100%; }
}
