:root {
  --bg: #edf6ff;
  --surface: rgba(255, 255, 255, 0.56);
  --surface-soft: rgba(255, 255, 255, 0.4);
  --surface-strong: rgba(255, 255, 255, 0.72);
  --border: rgba(255, 255, 255, 0.68);
  --border-strong: rgba(255, 255, 255, 0.86);
  --text: #121622;
  --muted: #657086;
  --teal: #00a9a6;
  --teal-2: #2de0cf;
  --teal-soft: #e0fffb;
  --cyan-soft: #dcfcff;
  --pink: #ff3d9a;
  --pink-soft: #ffe2f3;
  --lime: #82d616;
  --lime-soft: #efffd2;
  --violet: #7257ff;
  --violet-soft: #ece8ff;
  --amber: #f8a30d;
  --amber-soft: #fff0cf;
  --slate: #98a2b3;
  --slate-soft: #eef1f5;
  --blue-soft: #dfeaff;
  --green-soft: #e2fae8;
  --shadow: 0 28px 80px rgba(36, 50, 92, 0.16);
  --shadow-soft: 0 14px 34px rgba(44, 57, 93, 0.1);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --glass-blur: blur(26px) saturate(150%);
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(0, 169, 166, 0.2) 0%, transparent 28%),
    linear-gradient(210deg, rgba(255, 61, 154, 0.18) 0%, transparent 26%),
    linear-gradient(30deg, rgba(114, 87, 255, 0.18) 0%, transparent 32%),
    linear-gradient(180deg, #fbfdff 0%, #eef7ff 46%, #f7f2ff 100%);
  color: var(--text);
  font-family: "Nacelle", "Aptos", "Segoe UI", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
  filter: drop-shadow(0 32px 44px rgba(65, 74, 122, 0.16));
}

body::before {
  width: 46vw;
  height: 18vh;
  right: -12vw;
  top: 72px;
  transform: rotate(-14deg) skewX(-18deg);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(45, 224, 207, 0.38), rgba(255, 61, 154, 0.18)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.08));
}

body::after {
  width: 34vw;
  height: 20vh;
  left: 210px;
  bottom: -80px;
  transform: rotate(12deg) skewX(18deg);
  border-radius: 38px;
  background:
    linear-gradient(135deg, rgba(114, 87, 255, 0.24), rgba(45, 224, 207, 0.22)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.1));
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72) 0%, rgba(245, 251, 255, 0.46) 48%, rgba(246, 239, 255, 0.42) 100%);
  border: 1px solid var(--border);
  padding: 18px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 28px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow), var(--inset-highlight);
  overflow: hidden;
}

.sidebar::before,
.page-header::before,
.toolbar::before,
.stat-card::before,
.table-card::before,
.detail-panel::before,
.import-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, rgba(45, 224, 207, 0.12), rgba(255, 61, 154, 0.07));
}

.sidebar > *,
.page-header > *,
.toolbar > *,
.stat-card > *,
.table-card > *,
.detail-panel > *,
.import-panel > * {
  position: relative;
  z-index: 1;
}

.brand-lockup {
  padding: 2px 16px 0;
}

.brand-logo {
  display: block;
  width: 118px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 169, 166, 0.16));
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.nav-item.active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(230, 255, 250, 0.68)),
    linear-gradient(90deg, rgba(45, 224, 207, 0.18), rgba(255, 61, 154, 0.09));
  border-color: rgba(255, 255, 255, 0.86);
  color: var(--teal);
  box-shadow: 0 14px 26px rgba(0, 169, 166, 0.13), var(--inset-highlight);
  transform: translateX(2px);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.42);
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: var(--inset-highlight);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active .nav-icon {
  color: var(--teal);
  background: linear-gradient(135deg, rgba(45, 224, 207, 0.22), rgba(255, 255, 255, 0.72));
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff4d6d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 0 8px;
}

.settings-link {
  justify-self: start;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--inset-highlight);
}

.user-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--teal-2), var(--violet));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 24px rgba(70, 91, 190, 0.24);
}

.user-chip strong,
.user-chip span {
  display: block;
}

.user-chip span {
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  padding: 10px 8px 22px 0;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.page-header {
  position: sticky;
  top: 18px;
  z-index: 8;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.42)),
    linear-gradient(90deg, rgba(45, 224, 207, 0.14), rgba(255, 61, 154, 0.09));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow), var(--inset-highlight);
  isolation: isolate;
  overflow: hidden;
}

.page-header::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -28px;
  width: 128px;
  height: 86px;
  transform: rotate(-15deg) skewX(-14deg);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(45, 224, 207, 0.42), rgba(255, 61, 154, 0.22)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.1));
  box-shadow: 0 28px 44px rgba(62, 75, 132, 0.16);
  pointer-events: none;
}

.page-header h1 {
  margin: 0 0 6px;
  font-family: "Bricolage Grotesque", "Aptos Display", sans-serif;
  font-size: 2.35rem;
  line-height: 1.05;
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.usage-summary {
  margin-top: 8px;
  font-size: 0.92rem;
}

.usage-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 12px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.usage-green {
  background: rgba(222, 248, 230, 0.92);
  border-color: rgba(100, 191, 117, 0.35);
  color: #237a3d;
}

.usage-yellow {
  background: rgba(255, 246, 203, 0.92);
  border-color: rgba(216, 188, 70, 0.35);
  color: #8a6d00;
}

.usage-orange {
  background: rgba(255, 232, 205, 0.94);
  border-color: rgba(229, 138, 54, 0.35);
  color: #a25400;
}

.usage-red {
  background: rgba(255, 221, 226, 0.95);
  border-color: rgba(222, 92, 113, 0.35);
  color: #b4233c;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft), var(--inset-highlight);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  padding: 0 20px;
  border-color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(135deg, #27dfcf 0%, #08a7a4 48%, #7257ff 100%);
  color: #fff;
  font-weight: 800;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.12);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(36, 50, 92, 0.16), var(--inset-highlight);
}

.ghost-button {
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.54);
  font-weight: 700;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: #3f4a67;
}

.icon-button.small {
  width: 28px;
  min-height: 28px;
}

.toolbar {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) repeat(4, minmax(130px, 0.8fr)) minmax(120px, 0.8fr) 160px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.46);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-soft), var(--inset-highlight);
  isolation: isolate;
}

.toolbar label {
  display: block;
}

.toolbar input,
.toolbar select {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  box-shadow: var(--inset-highlight);
  outline: none;
}

.toolbar input:focus,
.toolbar select:focus,
.category-card input:focus,
.category-card textarea:focus,
.scoring-panel input:focus,
.scoring-panel select:focus,
.scoring-panel textarea:focus,
.detail-form input:focus,
.detail-form select:focus,
.detail-form textarea:focus,
.multi-select-button:focus {
  border-color: rgba(0, 169, 166, 0.45);
  box-shadow: 0 0 0 4px rgba(45, 224, 207, 0.13), var(--inset-highlight);
}

.search-box {
  position: relative;
  display: block;
}

.search-box span {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(45, 224, 207, 0.2), rgba(114, 87, 255, 0.12));
  color: var(--teal);
  font-weight: 900;
}

.view-toggle {
  height: 46px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--inset-highlight);
}

.view-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.view-toggle button.active {
  background: linear-gradient(135deg, rgba(45, 224, 207, 0.22), rgba(255, 255, 255, 0.8));
  color: var(--teal);
  font-weight: 800;
}

.category-layout,
.city-layout {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: 18px;
  align-items: start;
}

.city-layout {
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1.55fr);
}

.email-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.email-panel {
  position: relative;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow-soft), var(--inset-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  overflow: hidden;
}

.email-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.05)),
    linear-gradient(135deg, rgba(45, 224, 207, 0.1), rgba(255, 61, 154, 0.06));
}

.email-panel > * {
  position: relative;
  z-index: 1;
}

.email-variants-panel {
  margin-top: 18px;
  padding: 0 0 20px;
}

.email-form-grid,
.email-assign-counts {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.email-form-grid label,
.email-count-field,
.email-wide-field,
.email-variant-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.email-form-grid input,
.email-form-grid select,
.email-count-field input,
.email-wide-field textarea,
.email-variant-card input,
.email-variant-card textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  box-shadow: var(--inset-highlight);
  outline: none;
}

.email-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.email-meta {
  margin: 14px 0 0;
  color: var(--muted);
}

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

.email-variant-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: var(--shadow-soft), var(--inset-highlight);
}

.email-variant-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.email-variant-head span,
.suppression-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.email-table {
  min-width: 980px;
}

.email-table th,
.email-table td {
  white-space: normal;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.suppression-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.suppression-item {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
}

.suppression-item strong,
.suppression-item span {
  display: block;
}

.suppression-item p {
  margin: 8px 0 0;
  color: var(--text);
}

.category-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow-soft), var(--inset-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  isolation: isolate;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.04));
}

.category-card > * {
  position: relative;
  z-index: 1;
}

.category-card-header h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", "Aptos Display", sans-serif;
  font-size: 1.2rem;
}

.category-card-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.category-card label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
}

.category-card input,
.category-card textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  outline: none;
}

.category-card textarea {
  resize: vertical;
}

.category-card-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-start;
}

.city-stats-card {
  overflow: hidden;
}

.city-stats-header {
  padding: 20px 22px 6px;
}

.city-stats-header h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", "Aptos Display", sans-serif;
  font-size: 1.2rem;
}

.city-stats-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.city-table {
  min-width: 980px;
}

.city-table th,
.city-table td {
  white-space: normal;
}

.city-name-cell {
  min-width: 180px;
  font-weight: 800;
}

.metric-pill {
  min-width: 38px;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--inset-highlight);
  font-weight: 800;
}

.category-manager-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.category-row {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.34));
  box-shadow: var(--shadow-soft), var(--inset-highlight);
}

.category-row-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.category-row-name {
  font-size: 1rem;
}

.category-row-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-row-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.stat-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34));
  box-shadow: var(--shadow-soft), var(--inset-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  isolation: isolate;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -24px;
  width: 82px;
  height: 82px;
  transform: rotate(18deg) skewX(-14deg);
  border-radius: 22px;
  opacity: 0.54;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(45, 224, 207, 0.16));
  pointer-events: none;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-family: "Bricolage Grotesque", "Aptos Display", sans-serif;
  font-size: 1.6rem;
}

.stat-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 16px 28px rgba(36, 50, 92, 0.12), var(--inset-highlight);
}

.mint .stat-icon {
  background: var(--cyan-soft);
  color: var(--teal);
}

.magenta .stat-icon {
  background: var(--pink-soft);
  color: var(--pink);
}

.lime .stat-icon {
  background: var(--lime-soft);
  color: var(--lime);
}

.lilac .stat-icon {
  background: var(--violet-soft);
  color: var(--violet);
}

.amber .stat-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.stone .stat-icon {
  background: var(--slate-soft);
  color: #4b5565;
}

.scoring-reference {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.38)),
    linear-gradient(90deg, rgba(45, 224, 207, 0.1), rgba(114, 87, 255, 0.08));
  box-shadow: var(--shadow-soft), var(--inset-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.scoring-reference-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.scoring-reference h2,
.criteria-card h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", "Aptos Display", sans-serif;
}

.scoring-reference p {
  margin: 4px 0 0;
  color: var(--muted);
}

.scoring-reference-header > strong {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(45, 224, 207, 0.24), rgba(255, 255, 255, 0.76));
  color: #057b78;
  font-size: 0.9rem;
  box-shadow: var(--inset-highlight);
}

.criteria-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.criteria-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-soft), var(--inset-highlight);
}

.criteria-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.criteria-card h3 {
  font-size: 1rem;
}

.criteria-card-header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.criteria-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
}

.criteria-card li + li {
  margin-top: 6px;
}

.content-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.content-grid.detail-open {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.table-card,
.detail-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow), var(--inset-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  isolation: isolate;
}

.table-card {
  min-width: 0;
  overflow: hidden;
}

.table-wrap {
  overflow: auto;
  overscroll-behavior: contain;
  max-height: calc(100vh - 340px);
}

table {
  width: 100%;
  min-width: 1700px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.52);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(250, 253, 255, 0.92);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

tbody tr {
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.46);
}

tbody tr.selected {
  background:
    linear-gradient(90deg, rgba(221, 255, 250, 0.96) 0%, rgba(255, 255, 255, 0.76) 100%),
    linear-gradient(135deg, rgba(45, 224, 207, 0.16), rgba(255, 61, 154, 0.08));
  box-shadow: inset 4px 0 0 var(--teal), 0 12px 22px rgba(0, 169, 166, 0.08);
}

.checkbox-col,
.select-cell {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
}

.menu-col {
  width: 36px;
}

.checkbox-col,
.select-cell,
.business-col,
.business-cell,
.category-col,
.category-cell {
  position: sticky;
  background: rgba(250, 253, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.checkbox-col,
.select-cell {
  left: 0;
}

.business-col,
.business-cell {
  left: 46px;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: normal;
}

.category-col,
.category-cell {
  left: 226px;
  width: 154px;
  min-width: 154px;
  max-width: 154px;
  white-space: normal;
}

.checkbox-col,
.business-col,
.category-col {
  z-index: 5;
}

.select-cell,
.business-cell,
.category-cell {
  z-index: 3;
}

tbody tr:hover .select-cell,
tbody tr:hover .business-cell,
tbody tr:hover .category-cell {
  background: rgba(255, 255, 255, 0.9);
}

tbody tr.selected .select-cell,
tbody tr.selected .business-cell,
tbody tr.selected .category-cell {
  background: rgba(225, 255, 251, 0.96);
}

.address-cell {
  min-width: 240px;
  white-space: normal;
  line-height: 1.35;
}

.website-cell,
.instagram-cell,
.source-query-cell {
  min-width: 180px;
}

.website-cell a,
.instagram-cell a {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.source-query-cell {
  white-space: normal;
  line-height: 1.35;
}

.business-identity {
  display: block;
}

.business-text strong,
.detail-summary strong {
  display: block;
  font-weight: 700;
}

.business-text strong,
.business-text span,
.category-cell {
  overflow-wrap: anywhere;
  word-break: normal;
}

.business-text span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.score-pill {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: var(--inset-highlight);
  font-weight: 800;
  font-size: 0.85rem;
}

.fit-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--inset-highlight);
}

.status-pill.new {
  background: #e9f9dd;
  color: #49a833;
}

.fit-pill.good-fit {
  background: #edfadb;
  color: #61a81b;
}

.fit-pill.possible-fit,
.status-pill.approved-for-outreach,
.status-pill.approved {
  background: #f0eaff;
  color: #6650d5;
}

.fit-pill.weak-fit,
.status-pill.needs-review,
.status-pill.follow-up-later {
  background: #fff0d9;
  color: #e08b07;
}

.status-pill.not-interested {
  background: #edf0f5;
  color: #596273;
}

.status-pill.contacted {
  background: #e8f0ff;
  color: #3175d3;
}

.status-pill.assigned {
  background: #eefcff;
  color: #087d8f;
}

.status-pill.accepted {
  background: #e7faed;
  color: #238447;
}

.status-pill.failed {
  background: #ffe4e8;
  color: #c52f49;
}

.status-pill.suppressed {
  background: #edf0f5;
  color: #596273;
}

.status-pill.interested,
.status-pill.partnered {
  background: #dff6f1;
  color: #178c8a;
}

.table-footer {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  color: var(--muted);
}

.table-footer p {
  margin: 0;
  font-size: 0.95rem;
}

.table-bulk-actions {
  display: flex;
  align-items: center;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination button,
.page-size select {
  min-width: 40px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--inset-highlight);
}

.pagination button.active {
  border-color: #cde7e7;
  color: var(--teal);
}

.detail-panel {
  position: sticky;
  top: 108px;
  padding: 18px;
  max-height: calc(100vh - 128px);
  overflow: auto;
}

.detail-panel.is-hidden {
  display: none;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.detail-header h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", "Aptos Display", sans-serif;
  font-size: 1.18rem;
}

.detail-tabs {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.44);
}

.detail-tabs button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.detail-tabs button.active {
  background: linear-gradient(135deg, rgba(45, 224, 207, 0.18), rgba(255, 255, 255, 0.72));
  color: var(--teal);
}

.detail-summary {
  margin-top: 18px;
  min-width: 0;
}

.detail-summary p,
.detail-list span,
.scoring-panel span,
.detail-form label {
  color: var(--muted);
}

.detail-summary p {
  margin: 4px 0 6px;
}

.detail-summary a,
.detail-list a {
  color: #0f8ec6;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-summary div,
.detail-list div,
.detail-list strong,
.detail-list a {
  min-width: 0;
}

.detail-list,
.scoring-panel,
.detail-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.58);
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-list div {
  display: grid;
  gap: 4px;
}

.detail-list strong {
  font-size: 0.95rem;
}

.score-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.score-head strong {
  font-family: "Bricolage Grotesque", "Aptos Display", sans-serif;
  font-size: 1.1rem;
}

.scoring-panel label,
.detail-form label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
}

.scoring-panel input,
.scoring-panel select,
.scoring-panel textarea,
.detail-form input,
.detail-form select,
.detail-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  box-shadow: var(--inset-highlight);
  outline: none;
}

.detail-actions {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-actions button {
  flex: 1 1 140px;
}

.danger-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(238, 95, 110, 0.4);
  border-radius: 14px;
  background: rgba(255, 239, 242, 0.82);
  color: #cf344f;
  font-weight: 700;
  box-shadow: var(--inset-highlight);
}

.import-dialog {
  width: min(860px, calc(100vw - 32px));
  border: 0;
  border-radius: 28px;
  padding: 0;
  box-shadow: 0 34px 90px rgba(16, 24, 40, 0.24);
}

.import-dialog::backdrop {
  background:
    linear-gradient(135deg, rgba(18, 22, 34, 0.42), rgba(40, 52, 84, 0.32)),
    rgba(19, 26, 42, 0.26);
  backdrop-filter: blur(8px);
}

.import-panel {
  position: relative;
  margin: 0;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.48)),
    linear-gradient(90deg, rgba(45, 224, 207, 0.12), rgba(255, 61, 154, 0.08));
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  isolation: isolate;
  overflow: visible;
}

.import-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.import-header h2 {
  margin: 0 0 4px;
  font-family: "Bricolage Grotesque", "Aptos Display", sans-serif;
}

.import-header h2,
.scoring-reference h2,
.category-card-header h2 {
  letter-spacing: 0;
}

.import-header p {
  margin: 0;
  color: var(--muted);
}

.import-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.3fr) minmax(180px, 0.8fr);
  gap: 14px;
  align-items: start;
  z-index: 4;
}

.import-grid > label,
.manual-field {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.import-grid > label > input,
.import-grid > label > select,
.manual-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--inset-highlight);
}

.import-grid > label > input,
.import-grid > label > select {
  height: 44px;
  padding: 0 12px;
}

.multi-select {
  position: relative;
  z-index: 1;
}

.multi-select.open {
  z-index: 100;
}

.multi-select-button {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--text);
  text-align: left;
  box-shadow: var(--inset-highlight);
}

.multi-select-button::after {
  content: "v";
  float: right;
  color: var(--muted);
}

.multi-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 101;
  display: none;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 48px rgba(16, 24, 40, 0.16), var(--inset-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.multi-select.open .multi-select-menu {
  display: grid;
  gap: 6px;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
}

.multi-select-option:hover {
  background: rgba(45, 224, 207, 0.1);
}

.multi-select-option input {
  flex: 0 0 auto;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.wide-field {
  grid-column: span 1;
}

.import-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.dialog-links {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.manual-field {
  margin-top: 16px;
}

.manual-field textarea {
  min-height: 130px;
  padding: 12px;
}

.import-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1380px) {
  .toolbar,
  .stat-grid,
  .criteria-grid,
  .content-grid,
  .category-layout,
  .city-layout,
  .email-layout,
  .email-form-grid,
  .email-assign-counts,
  .email-variant-grid,
  .filters,
  .import-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-toggle,
  .search-box,
  .search-field {
    grid-column: span 2;
  }

  .content-grid,
  .content-grid.detail-open {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 12px;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
    gap: 12px;
  }

  .workspace {
    padding: 0 0 22px;
  }

  .brand-lockup {
    padding: 0 8px;
  }

  .brand-logo {
    width: 92px;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-item {
    min-height: 42px;
    justify-content: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 14px;
    font-size: 0.9rem;
  }

  .sidebar-footer {
    display: none;
  }

  .page-header,
  .header-actions,
  .toolbar,
  .criteria-grid,
  .category-layout,
  .city-layout,
  .email-layout,
  .email-form-grid,
  .email-assign-counts,
  .email-variant-grid,
  .filters,
  .table-footer,
  .detail-actions,
  .import-grid,
  .import-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page-header {
    position: static;
    padding: 16px;
    border-radius: 22px;
    gap: 14px;
  }

  .page-header h1 {
    font-size: 1.85rem;
  }

  .page-header p {
    font-size: 0.94rem;
  }

  .page-header::after {
    width: 92px;
    height: 58px;
    right: 12px;
    bottom: -22px;
  }

  .usage-chip {
    min-height: 32px;
    margin-top: 8px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .toolbar {
    margin-top: 14px;
    padding: 10px;
    gap: 8px;
    border-radius: 18px;
  }

  .toolbar input,
  .toolbar select,
  .view-toggle {
    height: 40px;
  }

  .stat-grid {
    margin-top: 14px;
    gap: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 72px;
    padding: 12px;
    border-radius: 18px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .stat-card strong {
    font-size: 1.35rem;
  }

  .content-grid {
    margin-top: 12px;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

  .table-wrap {
    max-height: none;
  }

  .view-toggle,
  .search-box,
  .search-field {
    grid-column: auto;
  }

  .table-footer {
    justify-items: start;
  }
}
