:root {
  --bg: #111315;
  --panel: #171a1d;
  --panel-2: #1e2328;
  --text: #e8edf2;
  --muted: #a7b0bb;
  --accent: #4da3ff;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at top left, #1d2228, #0f1113 60%);
  color: var(--text);
  min-height: 100vh;
}

.landing {
  padding: 6rem 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero p {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.6;
}

.chat-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #041a30;
  font-weight: 700;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
}

.chat-widget {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  width: min(360px, calc(100vw - 2rem));
  height: 520px;
  background: var(--panel);
  border: 1px solid #2a3138;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.hidden {
  display: none;
}

.chat-header {
  background: var(--panel-2);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.msg {
  max-width: 84%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.msg.assistant {
  align-self: flex-start;
  background: #252c33;
}

.msg.user {
  align-self: flex-end;
  background: #2c5f93;
}

.typing {
  padding: 0.45rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #2a3138;
}

.chat-form input {
  flex: 1;
  border: 1px solid #2f3942;
  border-radius: 8px;
  background: #12161a;
  color: var(--text);
  padding: 0.6rem 0.7rem;
}

.chat-form button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #041a30;
  font-weight: 700;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
}

@media (max-width: 640px) {
  .chat-widget {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 4rem;
    height: min(72vh, 540px);
  }
}

.leads-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.leads-header h1 {
  margin: 0;
}

.leads-header p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.leads-controls {
  margin-top: 1.25rem;
  display: flex;
  align-items: end;
  gap: 0.75rem;
}

.leads-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.leads-controls select,
.leads-controls button {
  border: 1px solid #2f3942;
  border-radius: 8px;
  background: #12161a;
  color: var(--text);
  padding: 0.55rem 0.65rem;
}

.leads-controls button {
  background: var(--accent);
  color: #041a30;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.leads-error {
  color: var(--danger);
  margin: 0.75rem 0;
}

.leads-table-wrap {
  margin-top: 0.75rem;
  overflow-x: auto;
  border: 1px solid #2a3138;
  border-radius: 10px;
  background: var(--panel);
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
}

.leads-table th,
.leads-table td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #2a3138;
  padding: 0.65rem;
  font-size: 0.88rem;
}

.leads-table th {
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
}

.leads-empty {
  margin-top: 0.8rem;
  color: var(--muted);
}

.leads-pagination {
  margin-top: 1rem;
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.leads-pagination button {
  border: 1px solid #2f3942;
  border-radius: 8px;
  background: #12161a;
  color: var(--text);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}

.leads-pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
