:root {
  --bg-night: #07111d;
  --bg-slate: #10233b;
  --bg-glow: #1d4f7a;
  --panel: rgba(9, 22, 39, 0.78);
  --panel-strong: rgba(11, 28, 48, 0.92);
  --panel-border: rgba(162, 201, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --text-main: #eef6ff;
  --text-muted: #9db1c9;
  --text-faint: #6d819b;
  --accent: #78dfd0;
  --accent-strong: #26b99e;
  --accent-warm: #ffc982;
  --danger: #ff8f85;
  --shadow-xl: 0 32px 90px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.2);
}

html {
  font-size: 16px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(38, 185, 158, 0.18), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(255, 201, 130, 0.14), transparent 22%),
    radial-gradient(circle at 70% 72%, rgba(60, 126, 190, 0.2), transparent 26%),
    linear-gradient(145deg, var(--bg-night) 0%, #0b1a2d 42%, var(--bg-slate) 100%);
  background-attachment: fixed;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
}

body::before {
  width: 22rem;
  height: 22rem;
  top: 5rem;
  right: -6rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 223, 208, 0.24), transparent 68%);
  filter: blur(10px);
}

body::after {
  width: 26rem;
  height: 26rem;
  bottom: -8rem;
  left: -8rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 112, 184, 0.28), transparent 70%);
}

a {
  color: inherit;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

label {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.app-shell {
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.btn {
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  color: #04131c;
  box-shadow: 0 12px 24px rgba(38, 185, 158, 0.24);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #04131c;
  box-shadow: 0 16px 34px rgba(38, 185, 158, 0.32);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.form-control {
  min-height: 3.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

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

.form-control:focus {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border-color: rgba(120, 223, 208, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(120, 223, 208, 0.14);
}

.text-danger,
.field-validation-error,
.validation-summary-errors {
  color: var(--danger) !important;
}

.validation-summary-errors ul {
  margin: 0 0 0.25rem;
  padding-left: 1rem;
}

.auth-shell {
  min-height: calc(100vh - 9rem);
  display: grid;
  align-items: center;
}

.auth-panel,
.lead-table-shell {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 31, 52, 0.88), rgba(7, 18, 33, 0.92));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-xl);
  border-radius: 2rem;
  backdrop-filter: blur(18px);
}

.auth-panel::before,
.lead-table-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 30%, transparent 70%, rgba(120, 223, 208, 0.06));
  pointer-events: none;
}

.auth-panel {
  width: min(520px, 100%);
  padding: 3rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.82rem;
  border-radius: 999px;
  background: rgba(120, 223, 208, 0.1);
  border: 1px solid rgba(120, 223, 208, 0.14);
  color: #aaf2e6;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.15rem;
}

.auth-copy,
.page-copy,
.meta-label,
.lead-id {
  color: var(--text-muted);
}

.auth-copy {
  max-width: 28rem;
  margin-top: 0.85rem;
  font-size: 1.02rem;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.auth-form .btn {
  margin-top: 0.8rem;
}

.auth-panel-wide {
  width: min(620px, 100%);
}

.auth-action-stack {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.8rem;
}

.btn-secondary-accent {
  background: linear-gradient(135deg, #ffc982, #f9a24d);
  border: none;
  color: #201003;
  box-shadow: 0 14px 28px rgba(249, 162, 77, 0.22);
}

.btn-secondary-accent:hover,
.btn-secondary-accent:focus {
  color: #201003;
  box-shadow: 0 18px 34px rgba(249, 162, 77, 0.3);
}

.auth-divider {
  position: relative;
  margin: 1.6rem 0 1.1rem;
  text-align: center;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 0.9rem;
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(14, 31, 52, 0.96), rgba(7, 18, 33, 0.96));
}

.auth-social-grid {
  display: grid;
  gap: 0.85rem;
}

.auth-social-grid form {
  margin: 0;
}

.btn-social {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

.btn-social:hover,
.btn-social:focus {
  color: var(--text-main);
}

.btn-social:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.btn-google {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.2), rgba(219, 68, 55, 0.2));
  border-color: rgba(111, 159, 239, 0.28);
}

.btn-google:hover,
.btn-google:focus {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.28), rgba(219, 68, 55, 0.28));
}

.btn-facebook {
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.22), rgba(70, 128, 238, 0.14));
  border-color: rgba(120, 168, 255, 0.22);
}

.btn-facebook:hover,
.btn-facebook:focus {
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.32), rgba(70, 128, 238, 0.2));
}

.auth-footer-link {
  margin-top: 1.35rem;
  text-align: center;
}

.auth-footer-link a,
.auth-message-link a {
  color: #b9f7ec;
  text-decoration: none;
  font-weight: 700;
}

.auth-footer-link a:hover,
.auth-footer-link a:focus,
.auth-message-link a:hover,
.auth-message-link a:focus {
  text-decoration: underline;
}

.auth-message {
  margin-top: 1.2rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  font-size: 0.96rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.auth-message-success {
  color: #dffaf3;
  background: rgba(120, 223, 208, 0.12);
  border-color: rgba(120, 223, 208, 0.24);
}

.auth-message-danger {
  color: #ffd0cb;
  background: rgba(255, 143, 133, 0.12);
  border-color: rgba(255, 143, 133, 0.24);
}

.auth-message-link {
  margin-top: 0.55rem;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.6rem;
}

.lead-actions-panel {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.lead-search-form {
  margin-left: 0.4rem;
}

.lead-search-input {
  width: min(22rem, 42vw);
  min-height: 3.15rem;
  border: 1px solid rgba(162, 201, 255, 0.24);
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: rgba(13, 31, 51, 0.86);
  color: var(--text-main);
  box-shadow: 0 18px 40px rgba(2, 8, 18, 0.18);
}

.lead-search-input::placeholder {
  color: var(--text-muted);
}

.lead-search-input:focus {
  border-color: rgba(126, 239, 215, 0.72);
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(126, 239, 215, 0.13);
}

.lead-filter-button {
  width: 3.15rem;
  height: 3.15rem;
  border: 1px solid rgba(162, 201, 255, 0.18);
  border-radius: 50%;
  background: rgba(13, 31, 51, 0.86);
  color: var(--text-main);
  display: grid;
  place-items: center;
}

.lead-filter-icon {
  width: 1.2rem;
  height: 0.9rem;
  border: 0.14rem solid currentColor;
  border-top: 0;
  clip-path: polygon(0 0, 100% 0, 62% 50%, 62% 100%, 38% 100%, 38% 50%);
  background: currentColor;
}

.lead-filter-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.lead-filter-dates > div {
  display: grid;
  gap: 0.4rem;
}

.lead-filter-multiple {
  min-height: 7.25rem;
  padding: 0.35rem;
}

.lead-action-circle {
  position: relative;
  width: 3.15rem;
  height: 3.15rem;
  border: 1px solid rgba(162, 201, 255, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(126, 239, 215, 0.22), transparent 46%),
    linear-gradient(180deg, rgba(20, 38, 61, 0.96), rgba(8, 20, 36, 0.98));
  color: #eef6ff;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 18px 40px rgba(2, 8, 18, 0.28);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.lead-action-circle:hover,
.lead-action-circle:focus {
  transform: translateY(-2px);
  border-color: rgba(126, 239, 215, 0.4);
  box-shadow: 0 22px 42px rgba(2, 8, 18, 0.34);
}

.lead-action-circle::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.75rem);
  transform: translateX(-50%) translateY(0.2rem);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(162, 201, 255, 0.18);
  background: rgba(8, 20, 36, 0.96);
  color: #eef6ff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 28px rgba(2, 8, 18, 0.28);
  transition: opacity 160ms ease, transform 160ms ease;
}

.lead-action-circle:hover::after,
.lead-action-circle:focus::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lead-action-circle[data-tooltip-align="start"]::after {
  left: 0;
  transform: translateX(0) translateY(0.2rem);
}

.lead-action-circle[data-tooltip-align="start"]:hover::after,
.lead-action-circle[data-tooltip-align="start"]:focus::after {
  transform: translateX(0) translateY(0);
}

.lead-action-icon {
  position: relative;
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
}

.lead-action-icon::before,
.lead-action-icon::after {
  content: "";
  position: absolute;
}

.lead-action-icon-upload::before {
  left: 0.62rem;
  top: 0.12rem;
  width: 0.18rem;
  height: 0.82rem;
  background: currentColor;
  border-radius: 999px;
}

.lead-action-icon-upload::after {
  left: 0.38rem;
  top: 0.08rem;
  width: 0.64rem;
  height: 0.64rem;
  border-top: 0.18rem solid currentColor;
  border-left: 0.18rem solid currentColor;
  transform: rotate(45deg);
}

.lead-action-icon-download::before {
  left: 0.62rem;
  top: 0.18rem;
  width: 0.18rem;
  height: 0.82rem;
  background: currentColor;
  border-radius: 999px;
}

.lead-action-icon-download::after {
  left: 0.38rem;
  top: 0.52rem;
  width: 0.64rem;
  height: 0.64rem;
  border-right: 0.18rem solid currentColor;
  border-bottom: 0.18rem solid currentColor;
  transform: rotate(45deg);
}

.lead-action-icon-csv::before {
  inset: 0.1rem 0.16rem;
  border: 0.12rem solid currentColor;
  border-radius: 0.22rem;
}

.lead-action-icon-csv::after {
  left: 0.28rem;
  top: 0.38rem;
  width: 0.82rem;
  height: 0.1rem;
  background: currentColor;
  box-shadow: 0 0.28rem 0 currentColor, 0 -0.28rem 0 currentColor;
}

.lead-action-icon-notes::before {
  inset: 0.12rem 0.14rem 0.14rem;
  border: 0.12rem solid currentColor;
  border-radius: 0.22rem;
}

.lead-action-icon-notes::after {
  left: 0.34rem;
  top: 0.34rem;
  width: 0.7rem;
  height: 0.08rem;
  background: currentColor;
  box-shadow: 0 0.24rem 0 currentColor, 0 0.48rem 0 currentColor;
}

.lead-action-icon-plus::before {
  left: 0.62rem;
  top: 0.2rem;
  width: 0.16rem;
  height: 1rem;
  background: currentColor;
  border-radius: 999px;
}

.lead-action-icon-plus::after {
  left: 0.2rem;
  top: 0.62rem;
  width: 1rem;
  height: 0.16rem;
  background: currentColor;
  border-radius: 999px;
}

.lead-action-icon-groups::before {
  left: 0.14rem;
  top: 0.2rem;
  width: 0.44rem;
  height: 0.44rem;
  border: 0.12rem solid currentColor;
  border-radius: 50%;
  box-shadow: 0.68rem 0 0 -0.02rem currentColor;
}

.lead-action-icon-groups::after {
  left: 0.08rem;
  top: 0.78rem;
  width: 0.52rem;
  height: 0.24rem;
  border: 0.12rem solid currentColor;
  border-top: 0;
  border-radius: 0 0 0.4rem 0.4rem;
  box-shadow: 0.68rem 0 0 -0.02rem currentColor;
}

.page-copy {
  margin-top: 0.8rem;
  max-width: 46rem;
  font-size: 1rem;
  line-height: 1.65;
}

.hero-meta {
  min-width: 240px;
  padding: 1.1rem 1.2rem;
  border-radius: 1.35rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-md);
}

.hero-meta strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.1rem;
}

.hero-meta-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-right: 1rem;
}

.hero-user-meta {
  margin-left: auto;
  text-align: right;
}

.hero-signout-form {
  flex: 0 0 auto;
  margin: 0;
}

.admin-entry-button {
  margin-right: 60px;
}

.lead-table-shell {
  padding: 1.15rem;
  overflow-x: auto;
}

.lead-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.lead-pagination-link {
  min-width: 2.5rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  text-decoration: none;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.lead-pagination-link:hover,
.lead-pagination-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(120, 223, 208, 0.45);
  background: rgba(120, 223, 208, 0.12);
  color: var(--text-main);
}

.lead-pagination-link.is-active {
  background: linear-gradient(135deg, rgba(120, 223, 208, 0.28), rgba(38, 185, 158, 0.22));
  border-color: rgba(120, 223, 208, 0.55);
  color: var(--text-main);
  box-shadow: 0 10px 24px rgba(38, 185, 158, 0.16);
}

.lead-pagination-link.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.lead-pagination-ellipsis {
  pointer-events: none;
  user-select: none;
}

.lead-pagination-ellipsis:hover,
.lead-pagination-ellipsis:focus-visible {
  transform: none;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.upload-preview-shell {
  max-height: 22rem;
  overflow: auto;
  border-radius: 1rem;
  border: 1px solid var(--line-soft);
}

.upload-preview-table {
  min-width: 820px;
}

.admin-shell {
  max-width: 880px;
}

.admin-panel {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: 1.9rem;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(14, 31, 52, 0.88), rgba(7, 18, 33, 0.92));
  box-shadow: var(--shadow-xl);
}

.admin-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 30%, transparent 70%, rgba(120, 223, 208, 0.06));
  pointer-events: none;
}

.admin-picker-form,
.admin-form {
  position: relative;
  z-index: 1;
}

.admin-picker-form {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.admin-select {
  min-height: 3.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: 1rem;
  padding: 0.95rem 1rem;
}

.admin-select:focus {
  border-color: rgba(120, 223, 208, 0.8);
  box-shadow: 0 0 0 0.2rem rgba(120, 223, 208, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
}

.admin-form {
  display: grid;
  gap: 0.8rem;
}

.admin-lead-intake-form {
  margin-top: 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-textarea {
  min-height: 14rem;
  resize: vertical;
}

.admin-intake-textarea {
  min-height: 11rem;
}

.admin-help {
  margin: -0.1rem 0 0.3rem;
}

.lead-dialog {
  width: min(700px, calc(100% - 2rem));
  padding: 0;
  border: 0;
  background: transparent;
}

.lead-dialog::backdrop {
  background: rgba(3, 10, 20, 0.74);
  backdrop-filter: blur(10px);
}

.lead-dialog[open] {
  display: grid;
  place-items: center;
}

.lead-dialog-card {
  width: 100%;
}

.lead-form {
  max-height: min(72vh, 900px);
  overflow-y: auto;
  padding-right: 2rem;
}

.lead-table {
  margin: 0;
  color: var(--text-main);
  border-collapse: separate;
  border-spacing: 0;
  --bs-table-color: var(--text-main);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line-soft);
  --bs-table-striped-color: var(--text-main);
  --bs-table-hover-color: var(--text-main);
}

.lead-table thead th {
  padding: 0.85rem 0.9rem 0.95rem;
  color: #8fa9c7;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
}

.lead-selection-column {
  width: 1%;
  min-width: 4.5rem;
  text-align: center;
}

.lead-selection-checkbox {
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

.lead-selection-summary {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(120, 223, 208, 0.35);
  border-radius: 0.8rem;
  background: rgba(120, 223, 208, 0.1);
  color: #d9fff8;
  font-weight: 700;
}

.bulk-lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: -0.2rem 0 1rem;
}

.bulk-group-operation {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-main);
}

.bulk-group-operation label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.lead-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
}

.lead-sort-link:hover,
.lead-sort-link:focus-visible {
  color: var(--text-main);
  text-decoration: none;
}

.lead-table tbody tr {
  transition: background 160ms ease, transform 160ms ease;
}

.lead-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.lead-row-trigger {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.lead-row-trigger:hover,
.lead-row-trigger:focus {
  color: inherit;
}

.lead-table td {
  padding: 0.85rem 0.9rem;
  border-color: var(--line-soft);
  background: transparent;
  vertical-align: middle;
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.3;
}

.lead-table strong {
  color: #f5f9ff;
  font-size: 0.98rem;
  font-weight: 700;
}

.lead-table tbody td:nth-child(2),
.lead-table tbody td:nth-child(3),
.lead-table tbody td:nth-child(4),
.lead-table tbody td:nth-child(6),
.lead-table tbody td:nth-child(7) {
  color: #dfe9f7;
}

.lead-table tbody td:nth-child(3) div:first-child,
.lead-table tbody td:nth-child(4),
.lead-table tbody td:nth-child(6),
.lead-table tbody td:nth-child(7) {
  font-weight: 600;
}

.lead-table tbody td:nth-child(3) div:last-child {
  color: #a8bdd8;
  margin-top: 0.2rem;
}

.contact-email-row,
.contact-phone-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-email-row {
  display: inline-flex;
  justify-content: flex-start;
  gap: 0.45rem;
  width: auto;
  max-width: 100%;
}

.contact-phone-row {
  margin-top: 0.35rem;
}

.lead-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  margin-bottom: 1.25rem;
}

.lead-details-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.lead-details-item-full {
  grid-column: 1 / -1;
}

.lead-details-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-details-value {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.lead-group-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 0.15rem;
}

.lead-group-option {
  position: relative;
  display: block;
  min-height: 7rem;
  padding: 1rem 1rem 1rem 3.3rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.lead-group-option:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 223, 208, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.lead-group-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lead-group-option span {
  display: grid;
  gap: 0.25rem;
}

.lead-group-option span::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.22rem;
  border: 1px solid rgba(162, 201, 255, 0.35);
  background: rgba(8, 20, 36, 0.72);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.lead-group-option span::after {
  content: "";
  position: absolute;
  left: 1.28rem;
  top: 1.18rem;
  width: 0.34rem;
  height: 0.62rem;
  border-right: 0.14rem solid #04131c;
  border-bottom: 0.14rem solid #04131c;
  transform: rotate(45deg) scale(0.2);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.lead-group-option input:checked + span {
  color: #f5fffd;
}

.lead-group-option input:checked + span::before {
  border-color: rgba(120, 223, 208, 0.85);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 22px rgba(38, 185, 158, 0.22);
}

.lead-group-option input:checked + span::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.lead-group-option small {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.lead-details-notes {
  margin-top: 1.4rem;
}

.copy-email-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(120, 223, 208, 0.18);
  background: rgba(120, 223, 208, 0.1);
  color: #b6f8ee;
  border-radius: 999px;
  padding: 0;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.copy-email-button:hover,
.copy-email-button:focus {
  background: rgba(120, 223, 208, 0.18);
  border-color: rgba(120, 223, 208, 0.3);
  transform: translateY(-1px);
}

.copy-icon {
  position: relative;
  width: 0.9rem;
  height: 0.9rem;
  display: inline-block;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  border: 1.5px solid currentColor;
  border-radius: 0.18rem;
  background: transparent;
}

.copy-icon::before {
  width: 0.62rem;
  height: 0.62rem;
  top: 0.16rem;
  left: 0.16rem;
  opacity: 0.75;
}

.copy-icon::after {
  width: 0.62rem;
  height: 0.62rem;
  top: -0.02rem;
  left: -0.02rem;
  background: rgba(120, 223, 208, 0.06);
}

.copy-email-button.is-copied .copy-icon::before,
.copy-email-button.is-copied .copy-icon::after {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.copy-email-button.is-copied .copy-icon::before {
  width: 0.3rem;
  height: 0.62rem;
  top: 0.05rem;
  left: 0.34rem;
  opacity: 1;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(40deg);
}

.copy-email-button.is-copied .copy-icon::after {
  content: none;
}

.phone-link {
  color: #a8bdd8;
  text-decoration: none;
  font-weight: 600;
}

.phone-link:hover,
.phone-link:focus {
  color: #dff8f1;
  text-decoration: underline;
}

.notes-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(162, 201, 255, 0.18);
  background: rgba(162, 201, 255, 0.08);
  color: #d8e7ff;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.notes-link:hover,
.notes-link:focus {
  color: #f5f9ff;
  background: rgba(162, 201, 255, 0.14);
  border-color: rgba(162, 201, 255, 0.3);
  transform: translateY(-1px);
}

.notes-icon {
  position: relative;
  display: inline-block;
  width: 0.92rem;
  height: 0.92rem;
}

.notes-icon::before,
.notes-icon::after {
  content: "";
  position: absolute;
}

.notes-icon::before {
  inset: 0.04rem 0.1rem 0.08rem;
  border: 1.6px solid currentColor;
  border-radius: 0.18rem;
}

.notes-icon::after {
  left: 0.26rem;
  top: 0.28rem;
  width: 0.42rem;
  height: 0.04rem;
  background: currentColor;
  box-shadow: 0 0.18rem 0 currentColor, 0 0.36rem 0 currentColor;
}

.notes-preview {
  position: fixed;
  z-index: 60;
  width: min(360px, calc(100vw - 2rem));
  padding: 1rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(162, 201, 255, 0.18);
  background: rgba(8, 20, 36, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.notes-preview[hidden] {
  display: none;
}

.notes-preview-title {
  color: #eef6ff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

.notes-preview-body {
  display: grid;
  gap: 0.75rem;
}

.notes-preview-empty {
  margin: 0;
  color: #a8bdd8;
  font-size: 0.92rem;
  line-height: 1.5;
}

.notes-preview-item {
  padding: 0.8rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.notes-preview-time {
  display: block;
  color: #9eb5d2;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.notes-preview-text {
  margin: 0;
  color: #e6f0fb;
  font-size: 0.92rem;
  line-height: 1.5;
}

.memo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(120, 223, 208, 0.18);
  background: rgba(120, 223, 208, 0.08);
  color: #b6f8ee;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.memo-link:hover,
.memo-link:focus {
  background: rgba(120, 223, 208, 0.16);
  border-color: rgba(120, 223, 208, 0.3);
  color: #effcf8;
  transform: translateY(-1px);
}

.memo-icon {
  position: relative;
  display: inline-block;
  width: 0.96rem;
  height: 0.96rem;
}

.memo-icon::before,
.memo-icon::after {
  content: "";
  position: absolute;
}

.memo-icon::before {
  inset: 0.06rem 0.08rem 0.08rem;
  border: 1.6px solid currentColor;
  border-radius: 0.18rem;
}

.memo-icon::after {
  left: 0.24rem;
  top: 0.24rem;
  width: 0.46rem;
  height: 0.04rem;
  background: currentColor;
  box-shadow: 0 0.18rem 0 currentColor, 0 0.36rem 0 currentColor;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  border-radius: 999px;
  padding: 0.45rem 0.78rem;
  background: rgba(120, 223, 208, 0.12);
  border: 1px solid rgba(120, 223, 208, 0.12);
  color: #aaf2e6;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-pill-button {
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.status-pill-button:hover,
.status-pill-button:focus {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(2, 8, 18, 0.22);
}

.status-pill-new {
  background: rgba(120, 223, 208, 0.14);
  border-color: rgba(120, 223, 208, 0.22);
  color: #b4fbef;
}

.status-pill-open {
  background: rgba(255, 201, 130, 0.14);
  border-color: rgba(255, 201, 130, 0.22);
  color: #ffd9a3;
}

.status-pill-closed {
  background: rgba(255, 143, 133, 0.14);
  border-color: rgba(255, 143, 133, 0.24);
  color: #ffd2cc;
}

.alert-danger {
  border: 1px solid rgba(255, 143, 133, 0.28);
  background: rgba(255, 143, 133, 0.08);
  color: #ffd2cc;
  border-radius: 1rem;
}

.notes-shell {
  max-width: 920px;
  margin: 0 auto;
}

.notes-header {
  margin-bottom: 1.4rem;
}

.notes-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.notes-compose-card,
.notes-card {
  position: relative;
  overflow: hidden;
  padding: 1.3rem;
  border-radius: 1.7rem;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(14, 31, 52, 0.88), rgba(7, 18, 33, 0.92));
  box-shadow: var(--shadow-xl);
}

.notes-compose-card {
  margin-bottom: 1rem;
}

.notes-form {
  display: grid;
  gap: 0.8rem;
}

.notes-textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.notes-form-actions {
  display: flex;
  justify-content: flex-end;
}

.notes-list {
  display: grid;
  gap: 1rem;
}

.groups-dialog-list {
  display: grid;
  gap: 0.85rem;
}

.group-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.group-item-name {
  color: #f5f9ff;
  font-size: 0.98rem;
}

.note-item {
  padding: 1rem 1.05rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.note-time {
  display: inline-block;
  color: #a8bdd8;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.note-text {
  margin: 0.75rem 0 0;
  color: #e6f0fb;
  font-size: 1rem;
  line-height: 1.65;
}

.notes-empty {
  margin: 0;
  color: #d7e6fa;
  font-size: 1rem;
}

.notes-dialog-history {
  margin-top: 1.25rem;
}

.notes-dialog-subtitle {
  color: #eef6ff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.9rem;
}

.notes-dialog-list {
  max-height: 22rem;
  overflow-y: auto;
}

.memo-dialog {
  width:  calc(100% - 2rem);
  padding: 0;
  border: 0;
  background: transparent;
}

.memo-dialog::backdrop {
  background: rgba(3, 10, 20, 0.7);
  backdrop-filter: blur(10px);
}

.memo-dialog[open] {
  display: grid;
  place-items: center;
}

.memo-dialog-backdrop,
.memo-dialog-dismiss {
  display: none;
}

.memo-dialog-card {
  width: 100%;
  padding: 1.35rem;
  border-radius: 1.7rem;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(14, 31, 52, 0.96), rgba(7, 18, 33, 0.96));
  box-shadow: var(--shadow-xl);
}

.memo-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.memo-dialog-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.memo-dialog-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.1;
}

[data-lead-details-title] {
  color: var(--text-main);
}

.lead-details-name-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 13rem));
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.lead-details-name-input {
  min-height: 3.1rem;
  font-size: 1rem;
  font-weight: 700;
}

.lead-details-id-text {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.memo-close-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.memo-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 0.65rem;
  margin-right:1rem;
}

.memo-button-icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

.memo-form {
  display: grid;
  gap: 0.85rem;
}

.memo-textarea {
  min-height: 12rem;
  resize: vertical;
}

.memo-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .page-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .lead-actions-panel {
    justify-content: center;
    width: 100%;
  }

  .hero-meta {
    width: 100%;
    min-width: 0;
  }

  .hero-meta-actions {
    justify-content: space-between;
  }

  .hero-user-meta {
    text-align: left;
  }

  .admin-entry-button {
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }

  .app-shell {
    padding: 1.5rem 0 3rem;
  }

  .auth-panel {
    padding: 1.6rem;
    border-radius: 1.5rem;
  }

  .lead-table-shell {
    padding: 0.75rem;
    border-radius: 1.4rem;
  }

  .lead-table thead th,
  .lead-table td {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .contact-email-row {
    align-items: center;
    flex-direction: row;
  }

  .memo-dialog-card {
    padding: 1rem;
    border-radius: 1.3rem;
  }

  .memo-dialog-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .memo-form-actions {
    flex-direction: column-reverse;
  }
}
