:root {
  /* Colors pulled from AppsFlyer press kit (2023): #00C2FF, #7AD143, #220D4E */
  --af-blue: #00C2FF;
  --af-green: #7AD143;
  --af-ink: #220D4E;
  --text: #120B27;
  --muted: rgba(18, 11, 39, .70);
  --bg: #ffffff;
  --card: #ffffff;
  --border: rgba(34, 13, 78, .12);
  --shadow: 0 12px 30px rgba(34, 13, 78, .10);
  --radius: 18px;

  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.brand img {
  height: 26px;
  width: auto;
  display: block;
}

.brand .title {
  display: none;
  /* logo already contains wordmark */
}

/* User Profile / Logout */
.user-menu {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 14px;
}

.btn-logout {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(34, 13, 78, 0.05);
  color: var(--af-ink);
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.btn-logout:hover {
  background: rgba(34, 13, 78, 0.1);
}

/* Login Page Specifics */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: radial-gradient(circle at 50% 10%, rgba(0, 194, 255, .1), transparent 40%);
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--af-ink);
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

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

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--af-ink);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(34, 13, 78, 0.25);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  /* Ensure it's on top of everything */
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(34, 13, 78, 0.4);
  backdrop-filter: blur(2px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-content h3 {
  margin-top: 0;
  color: var(--af-ink);
}

.modal-content input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 8px;
  font-size: 15px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--af-blue);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .2s;
}

.btn-primary:hover {
  filter: brightness(0.9);
}

.error-msg {
  color: #e53935;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}

/* Dashboard / Roadmap */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(34, 13, 78, .06);
  font-weight: 600;
  font-size: 13px;
  color: rgba(18, 11, 39, .86);
}

.pill select {
  border: none;
  outline: none;
  font: inherit;
  background: transparent;
  cursor: pointer;
  color: var(--af-ink);
  padding-right: 2px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 420px at 18% 0%, rgba(0, 194, 255, .18), transparent 58%),
    radial-gradient(800px 360px at 92% 12%, rgba(122, 209, 67, .14), transparent 60%),
    linear-gradient(180deg, rgba(34, 13, 78, .03), rgba(255, 255, 255, 0));
}

.hero__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 42px 18px 26px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 920px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--af-ink);
}

.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 64ch;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(18, 11, 39, .82);
  background: rgba(255, 255, 255, .75);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--af-blue);
}

.dot.green {
  background: var(--af-green);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .8);
  box-shadow: var(--shadow);
  padding: 14px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--af-ink);
  letter-spacing: -0.01em;
}

.panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.toggles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  margin: 0;
}

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 8px 0 26px;
}

@media (max-width: 1020px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 24px rgba(34, 13, 78, .08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  transition: transform .12s ease, box-shadow .12s ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(34, 13, 78, .12);
}

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

.card h3 {
  margin: 0;
  font-size: 16px;
  color: var(--af-ink);
  letter-spacing: -0.01em;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 194, 255, .08);
  color: rgba(34, 13, 78, .88);
  white-space: nowrap;
}

.tag.green {
  background: rgba(122, 209, 67, .12);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}

.num {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: rgba(34, 13, 78, .92);
  border: 1px solid var(--border);
  background: rgba(34, 13, 78, .04);
  user-select: none;
}

.item b {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  color: rgba(18, 11, 39, .96);
}

.item small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.fade-enter {
  animation: fadeIn .18s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 8px 18px 30px;
  color: rgba(18, 11, 39, .60);
  font-size: 12px;
  line-height: 1.45;
}

footer code {
  background: rgba(34, 13, 78, .06);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 12px;
  }

  .user-menu {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand {
    min-width: unset;
  }

  .pill {
    font-size: 12px;
    padding: 8px 10px;
  }

  .hero__inner {
    padding: 24px 16px;
    gap: 24px;
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 14px;
  }

  .actions-bar {
    flex-direction: column;
  }

  .btn-action {
    width: 100%;
    text-align: center;
  }

  .panel {
    margin-top: 10px;
  }

  /* Adjust grid for mobile is already handled by .grid media queries, but let's ensure card padding is comfortable */
  .card {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px;
    width: 90%;
  }

  .topbar .pill span {
    display: none;
    /* Hide "Customer type" label on very small screens */
  }
}