﻿:root {
  --ink: #0f1f31;
  --muted: #5f748a;
  --line: #d7e4ef;
  --line-strong: #c2d5e6;
  --card: #ffffff;
  --surface: #eef4f8;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-lg: 0 18px 45px rgba(13, 35, 54, 0.12);
  --shadow-md: 0 10px 24px rgba(13, 35, 54, 0.08);
  font-family: "Manrope", sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, #d8f3ff 0%, transparent 42%),
    radial-gradient(circle at 100% 12%, #e8fff2 0%, transparent 36%),
    linear-gradient(180deg, #f5faff 0%, #edf3f8 100%);
}

.backdrop-shape {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(85px);
  opacity: 0.3;
  z-index: 0;
}

.backdrop-shape.one {
  width: 360px;
  height: 360px;
  top: -150px;
  right: -90px;
  background: var(--accent);
}

.backdrop-shape.two {
  width: 300px;
  height: 300px;
  left: -120px;
  bottom: 6vh;
  background: var(--primary);
}

.topbar,
.container {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  background: linear-gradient(180deg, #ffffffef, #ffffffdb);
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 28%, #d3e2ec);
  backdrop-filter: blur(14px);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.2rem;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.pill {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--line-strong);
  background: #f8fbff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.26rem 0.62rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

nav a {
  text-decoration: none;
  color: #1d2c3b;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.46rem 0.72rem;
  border-radius: 9px;
  transition: 140ms ease;
}

nav a:hover {
  background: #e7f0f7;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: #f3f9fd;
  color: #1e3a52;
  border: 1px solid #c8d8e5;
  box-shadow: none;
  padding: 0.36rem 0.7rem;
  font-size: 0.82rem;
}

.nav-shell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  overflow: visible;
}

.workspace-switch {
  margin: 0;
}

.workspace-switch select {
  min-width: 190px;
  width: auto;
  padding: 0.44rem 0.55rem;
  font-size: 0.86rem;
}

.main-nav {
  display: flex;
  gap: 0.42rem;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: #1d2c3b;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.46rem 0.72rem;
  border-radius: 9px;
  transition: 140ms ease;
}

.main-nav a:hover {
  background: #e7f0f7;
  transform: translateY(-1px);
}

.main-nav a.is-active {
  background: color-mix(in srgb, var(--primary) 14%, #f3f9fd);
  color: color-mix(in srgb, var(--primary) 82%, #17324a);
}

.nav-dropdown {
  position: relative;
  z-index: 2100;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  color: #1f3447;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.44rem 0.72rem;
  border-radius: 999px;
  border: 1px solid #d3e1ec;
  background: #f8fbfe;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  user-select: none;
}

.nav-dropdown summary:hover {
  background: #eef6fb;
  border-color: #bdd2e3;
}

.nav-dropdown summary::after {
  content: "▾";
  font-size: 0.72rem;
  color: #5d7489;
  transform: translateY(-1px);
}

.nav-dropdown[open] summary {
  background: color-mix(in srgb, var(--primary) 12%, #f1f8fc);
  border-color: color-mix(in srgb, var(--primary) 34%, #c4d9e9);
}

.nav-dropdown[open] summary::after {
  content: "▴";
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 210px;
  border: 1px solid #d6e4ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 18px 36px rgba(18, 42, 63, 0.16);
  padding: 0.38rem;
  display: none;
  z-index: 2200;
}

.nav-dropdown[open] .dropdown-menu {
  display: grid;
  gap: 0.18rem;
}

.workspace-dropdown .dropdown-menu {
  left: 0;
  right: auto;
}

.dropdown-menu a {
  text-decoration: none;
  color: #1d2c3b;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 0.68rem;
  border-radius: 8px;
}

.dropdown-menu a:hover {
  background: #edf5fb;
}

.dropdown-menu a.is-active {
  background: color-mix(in srgb, var(--primary) 14%, #edf5fb);
  color: color-mix(in srgb, var(--primary) 80%, #18374f);
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.3rem;
}

.nav-user {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38516a;
  background: #f2f8fc;
  border: 1px solid #d4e3ee;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.logout-link {
  text-decoration: none !important;
  color: #9a1f1f;
  font-weight: 700;
  padding: 0.5rem 0.62rem;
  border-radius: 8px;
  margin-top: 0.12rem;
}

.logout-link:hover {
  background: #fcebea;
}

.container {
  max-width: 1180px;
  margin: 1.25rem auto;
  padding: 0 1rem 2.4rem;
  animation: fadeSlide 280ms ease;
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto 1.4rem;
  padding: 0 1rem;
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer a {
  color: #36556f;
  text-decoration: none;
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: underline;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.page-head h1 {
  margin-bottom: 0.2rem;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.05rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-lg);
  overflow: clip;
}

.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(130deg, color-mix(in srgb, var(--primary) 16%, transparent), transparent 45%, color-mix(in srgb, var(--accent) 14%, transparent));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.card.narrow {
  max-width: 760px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-size: 0.74rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0.2rem 0 0.7rem;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

h3 {
  font-size: 1.04rem;
}

.muted {
  color: var(--muted);
  margin-top: 0.3rem;
}

.hero-actions,
.toolbar {
  display: flex;
  gap: 0.56rem;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.stat {
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}

.stat p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.stat h2 {
  margin: 0.34rem 0 0;
  color: color-mix(in srgb, var(--primary) 84%, #0a1e31);
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}

.chart-card canvas {
  margin-top: 0.35rem;
}

button,
.button {
  display: inline-block;
  border: 0;
  border-radius: 11px;
  text-decoration: none;
  cursor: pointer;
  padding: 0.58rem 0.96rem;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 42%, transparent);
  transition: 170ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 48%, transparent);
}

.button.ghost {
  background: #fff;
  color: #1d3650;
  border: 1px solid #c5d6e4;
  box-shadow: none;
}

.button.secondary {
  background: #111827;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.28);
}

.action-link {
  text-decoration: none;
  color: color-mix(in srgb, var(--primary) 84%, #153049);
  font-weight: 700;
  margin-right: 0.5rem;
}

.action-link.danger {
  color: #b42323;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d8e5;
  border-radius: 10px;
  padding: 0.62rem 0.67rem;
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 55%, #88a7bf);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #334b61;
}

.form-grid p {
  margin: 0.84rem 0;
}

.form-grid .helptext {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.28rem;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 0.56rem;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.5rem;
}

thead th,
th {
  color: #3b4f63;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f3f8fc;
  position: sticky;
  top: 0;
  z-index: 1;
}

th,
td {
  padding: 0.68rem 0.5rem;
  border-bottom: 1px solid #e3ecf4;
  text-align: left;
}

tbody tr {
  background: #fff;
  transition: 140ms ease;
}

tbody tr:hover {
  background: #f6fbff;
}

.table-shell {
  border: 1px solid #d9e5ef;
  border-radius: 14px;
  overflow: auto;
  background: #fff;
}

.table-shell table {
  margin-top: 0;
}

.email-table td:first-child,
.email-table th:first-child {
  width: 64px;
  text-align: center;
}

.email-table input[type="radio"] {
  width: auto;
  transform: scale(1.06);
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border: 1px solid #dbe8f3;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: #f8fbfe;
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2e475d;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #d0dde8;
  border-radius: 999px;
  transition: 0.2s ease;
  border: 1px solid #b8cadd;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: 0.2s ease;
}

.switch input:checked + .slider {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  border-color: color-mix(in srgb, var(--primary) 55%, #98b7cf);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.chip {
  color: #fff;
  padding: 0.16rem 0.54rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.category-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.42rem;
}

.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #f7fbff;
  border: 1px solid #dbe8f3;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}

.onboarding-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.onboarding-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid #dbe8f3;
  border-radius: 10px;
  background: #f8fbfe;
}

.badge-success,
.badge-pending {
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.badge-success {
  color: #14532d;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.badge-pending {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.messages li {
  padding: 0.62rem 0.8rem;
  border-radius: 10px;
  background: #e8f7ee;
  border: 1px solid #bfe9cd;
  color: #14532d;
}

.empty-state {
  border: 1px dashed #c9d9e6;
  border-radius: 12px;
  padding: 0.9rem;
  color: var(--muted);
  background: #f8fbfe;
}

.auth-card {
  max-width: 520px;
  margin: 1.2rem auto;
}

@media (max-width: 800px) {
  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .brand-wrap {
    width: 100%;
  }

  .nav-toggle {
    display: inline-block;
  }

  .nav-shell {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding-top: 0.25rem;
  }

  .nav-shell.is-open {
    display: flex;
  }

  .workspace-switch select {
    width: 100%;
  }

  .main-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .main-nav a {
    text-align: center;
  }

  .nav-dropdown summary {
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    min-width: 0;
    width: 100%;
    box-shadow: 0 8px 18px rgba(18, 42, 63, 0.08);
    border: 1px solid #dce8f2;
    margin-top: 0.35rem;
  }

  .nav-meta {
    margin-left: 0;
    justify-content: stretch;
    width: 100%;
  }

  .user-dropdown {
    width: 100%;
  }

  .user-dropdown summary {
    text-align: center;
  }

  .hero,
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer {
    justify-content: center;
    text-align: center;
  }

  .pill {
    display: none;
  }
}
