/* Liquid Glass — warm cream & white theme */

:root {
  --cream-50: #fffdf9;
  --cream-100: #faf6ef;
  --cream-200: #f3ebe0;
  --cream-300: #e8ddd0;
  --cream-400: #d4c4b0;

  --text-heading: #2c2824;
  --text-body: #4a4540;
  --text-label: #5c5348;
  --text-muted: #8a8178;
  --text-faint: #a89f94;

  --link: #7a6248;
  --link-hover: #5c4a36;

  --accent: #8b7355;
  --accent-dark: #6f5a43;
  --accent-glow: rgba(139, 115, 85, 0.22);

  --glass-bg: rgba(255, 253, 249, 0.82);
  --glass-bg-solid: rgba(255, 252, 247, 0.95);
  --glass-border: rgba(212, 196, 176, 0.55);
  --glass-shadow: 0 8px 32px rgba(60, 48, 36, 0.08);
}

body.glass-body {
  min-height: 100vh;
  background: linear-gradient(145deg, #fffdf9 0%, #faf3e8 40%, #f5ebe0 75%, #f0e6d8 100%);
  background-attachment: fixed;
  color: var(--text-body);
}

.mesh-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.9) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(243, 230, 214, 0.65) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 248, 240, 0.5) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Remap legacy dark-theme Tailwind utilities to cream palette */
body.glass-body .text-white { color: var(--text-heading) !important; }
body.glass-body .text-slate-200 { color: var(--text-body) !important; }
body.glass-body .text-slate-300 { color: var(--text-label) !important; }
body.glass-body .text-slate-400 { color: var(--text-muted) !important; }
body.glass-body .text-slate-500 { color: var(--text-faint) !important; }
body.glass-body .text-indigo-300,
body.glass-body .text-indigo-400 { color: var(--link) !important; }
body.glass-body a.text-indigo-400:hover { color: var(--link-hover) !important; }

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  box-shadow: var(--glass-shadow);
}

.glass-nav {
  background: var(--glass-bg-solid);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.glass-sidebar {
  background: var(--glass-bg-solid);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
}

.glass-input {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--cream-400);
  border-radius: 0.5rem;
  color: var(--text-heading);
  padding: 0.625rem 0.875rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.glass-input::placeholder {
  color: var(--text-faint);
}

.glass-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #fff;
}

.glass-input option {
  background: #fffdf9;
  color: var(--text-heading);
}

.glass-btn {
  background: linear-gradient(135deg, #a68b5b 0%, #8b7355 100%);
  border: 1px solid rgba(111, 90, 67, 0.25);
  border-radius: 0.5rem;
  color: #fffdf9;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.glass-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--accent-glow);
  background: linear-gradient(135deg, #b89968 0%, #7a6248 100%);
}

.glass-btn-secondary {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--cream-400);
  border-radius: 0.5rem;
  color: var(--text-label);
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.glass-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--accent);
  color: var(--text-heading);
}

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

.glass-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cream-400);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.glass-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(212, 196, 176, 0.35);
  color: var(--text-body);
}

.glass-table tr:hover td {
  background: rgba(255, 255, 255, 0.55);
}

.leads-table td,
.leads-table th {
  vertical-align: middle;
}

.leads-table .col-serial {
  width: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.leads-table .col-phone {
  white-space: nowrap;
  font-size: 0.8125rem;
}

.leads-table .col-status {
  white-space: nowrap;
}

.leads-table .status-pills {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  align-items: center;
}

.leads-table .col-name {
  min-width: 10rem;
  max-width: 14rem;
}

.maps-link-progress-banner.is-running {
  border-color: #5b7a9b;
  box-shadow: 0 0 0 1px rgba(91, 122, 155, 0.25);
}

.maps-link-progress-bar-fill {
  background: linear-gradient(90deg, #6b8caf, #5b7a9b);
}

.ai-progress-banner.is-running {
  border-color: #8b7355;
  box-shadow: 0 0 0 1px rgba(139, 115, 85, 0.25);
}

.ai-progress-bar-fill {
  background: linear-gradient(90deg, #b89b6d, #8b7355);
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 196, 176, 0.35);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.progress-current-lead {
  font-size: 0.75rem;
  color: var(--text-body);
  font-weight: 500;
  margin-top: 0.35rem;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

.pill-synced { background: rgba(74, 124, 89, 0.12); color: #3d6b4f; border: 1px solid rgba(74, 124, 89, 0.25); }
.pill-pending { background: rgba(138, 129, 120, 0.12); color: #6b635c; border: 1px solid rgba(138, 129, 120, 0.25); }
.pill-ai { background: rgba(139, 115, 85, 0.12); color: #6f5a43; border: 1px solid rgba(139, 115, 85, 0.25); }
.pill-warning { background: rgba(180, 130, 50, 0.12); color: #8a6420; border: 1px solid rgba(180, 130, 50, 0.25); }
.pill-skipped { background: rgba(180, 130, 50, 0.12); color: #8a6420; border: 1px solid rgba(180, 130, 50, 0.25); }
.pill-error { background: rgba(185, 80, 70, 0.12); color: #9a4038; border: 1px solid rgba(185, 80, 70, 0.25); }

.nav-link {
  display: block;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-heading);
  box-shadow: inset 0 0 0 1px var(--cream-400);
}

.flash-success { background: rgba(74, 124, 89, 0.1); border: 1px solid rgba(74, 124, 89, 0.25); color: #3d6b4f; }
.flash-error { background: rgba(185, 80, 70, 0.1); border: 1px solid rgba(185, 80, 70, 0.25); color: #9a4038; }
.flash-info { background: rgba(139, 115, 85, 0.1); border: 1px solid rgba(139, 115, 85, 0.25); color: #6f5a43; }
.flash-warning { background: rgba(180, 130, 50, 0.1); border: 1px solid rgba(180, 130, 50, 0.25); color: #8a6420; }

.flash-message {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  backdrop-filter: blur(10px);
}

.content-wrapper {
  position: relative;
  z-index: 1;
}

.stat-card {
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.field-description {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.field-description code {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--cream-300);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  color: var(--text-label);
}

.setup-guide {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.setup-guide ol {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.setup-guide li {
  margin-bottom: 0.35rem;
}

.filter-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.filter-panel-toggle:hover .filter-panel-title {
  color: var(--text-heading);
}

.filter-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.filter-chevron {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.15s;
}

.filter-chevron.is-open {
  transform: rotate(180deg);
  color: var(--accent);
}

.filter-panel-body {
  overflow: hidden;
}

[x-cloak] {
  display: none !important;
}

.fetch-progress-banner {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--cream-400);
  background: rgba(255, 255, 255, 0.88);
}

.fetch-progress-banner.is-running {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.fetch-progress-bar {
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--cream-200);
  overflow: hidden;
  margin-top: 0.75rem;
}

.fetch-progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #a68b5b, #8b7355);
  transition: width 0.4s ease;
}

.fetch-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.fetch-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 36, 0.35);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.fetch-modal {
  width: 100%;
  max-width: 24rem;
  padding: 1.5rem;
}

.sync-progress-banner.is-running {
  border-color: #6b8f71;
  box-shadow: 0 0 0 1px rgba(107, 143, 113, 0.25);
}

.sync-progress-bar-fill {
  background: linear-gradient(90deg, #7a9b80, #6b8f71);
}
