/* ========= APP SHELL ========= */
.app-body {
  background: var(--bg);
  min-height: 100vh;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-business {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.logout-form {
  margin: 0;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
  border-color: var(--fg-dim);
  color: var(--fg);
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ========= DASHBOARD HEADER ========= */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.dash-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.dash-sub {
  font-size: 0.88rem;
  color: var(--fg-dim);
}

/* ========= COUNT CARDS ========= */
.counts-row {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.count-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  text-decoration: none;
  flex: 1;
  min-width: 100px;
  transition: border-color 0.15s, background 0.15s;
}

.count-card:hover {
  border-color: var(--fg-dim);
}

.count-card--active {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.count-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}

.count-num--accent {
  color: var(--accent);
}

.count-label {
  display: block;
  font-size: 0.78rem;
  color: var(--fg-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-display);
}

/* ========= EMPTY STATE ========= */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.empty-text {
  font-size: 0.92rem;
  color: var(--fg-muted);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========= LEADS TABLE ========= */
.leads-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leads-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  white-space: nowrap;
}

.leads-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg);
}

.lead-row:last-child td {
  border-bottom: none;
}

.lead-row:hover td {
  background: var(--bg-surface);
}

.lead-name {
  display: block;
  font-weight: 500;
  color: var(--fg);
}

.lead-phone {
  display: block;
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

.lead-service {
  color: var(--fg-muted);
  max-width: 160px;
}

.lead-time {
  color: var(--fg-dim);
  font-size: 0.82rem;
  white-space: nowrap;
}

.lead-view-link {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.lead-view-link:hover {
  text-decoration: underline;
}

/* ========= SOURCE BADGE ========= */
.source-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.source-badge--call {
  background: #2d4a2d;
  color: #6fcf6f;
}

.source-badge--form {
  background: #2a3a55;
  color: #7eb3f5;
}

/* ========= STATUS SELECT ========= */
.status-select {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.status-select--new {
  background-color: #2d2d00;
  border-color: #665500;
  color: #ffd700;
}

.status-select--contacted {
  background-color: #1a2a3a;
  border-color: #2a4a6a;
  color: #7eb3f5;
}

.status-select--booked {
  background-color: #1a3a2a;
  border-color: #2a5a3a;
  color: #5fcf8f;
}

.status-select--closed {
  background-color: #2a1a2a;
  border-color: #4a2a4a;
  color: #cf8fcf;
}

/* ========= LEAD DETAIL ========= */
.detail-header {
  margin-bottom: 24px;
}

.back-link {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--fg);
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}

.detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-time {
  font-size: 0.82rem;
  color: var(--fg-dim);
}

.detail-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-field--full {
  grid-column: 1 / -1;
}

.field-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.field-value {
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.5;
}

.field-value--link {
  color: var(--accent);
  text-decoration: none;
}

.field-value--link:hover {
  text-decoration: underline;
}

.field-value--message {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  white-space: pre-wrap;
  font-size: 0.92rem;
  color: var(--fg-muted);
}

/* ========= AUTH PAGES ========= */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%), var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
}

.auth-brand {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.auth-sub {
  font-size: 0.92rem;
  color: var(--fg-muted);
  margin-bottom: 28px;
}

.form-error {
  background: #3a1a1a;
  border: 1px solid #6a2a2a;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #f08080;
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--fg-muted);
}

.form-input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--fg-dim);
}

.form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: opacity 0.15s;
  margin-top: 4px;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-full {
  width: 100%;
}

.auth-footer-text {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-align: center;
  margin-top: 20px;
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

/* ========= LANDING PAGE ADDITIONS ========= */
.btn-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 15px 32px;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  letter-spacing: -0.01em;
}

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

.btn-ghost-link {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-weight: 500;
}

.btn-ghost-link:hover {
  color: var(--fg);
}

.hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.closing-cta {
  margin: 32px 0 24px;
}

/* ========= RESPONSIVE ========= */
@media (max-width: 768px) {
  .app-main {
    padding: 24px 16px 60px;
  }

  .counts-row {
    gap: 8px;
  }

  .count-card {
    padding: 16px 12px;
    min-width: 70px;
  }

  .count-num {
    font-size: 1.4rem;
  }

  .leads-table th:nth-child(3),
  .leads-table td:nth-child(3) {
    display: none;
  }

  .detail-card {
    padding: 24px 20px;
  }

  .auth-card {
    padding: 28px 24px;
  }

  .nav-business {
    display: none;
  }
}
