/* The Pint Band — Lead CRM
 * Style adapted from /Pint Band CSV automator (sötét-zöld + arany pub-paletta).
 */

:root {
  --bg: #07130f;
  --bg-soft: rgba(10, 23, 18, 0.82);
  --panel: rgba(16, 34, 28, 0.84);
  --panel-strong: rgba(23, 46, 38, 0.94);
  --line: rgba(196, 167, 108, 0.18);
  --line-strong: rgba(196, 167, 108, 0.34);
  --text: #f3ead7;
  --muted: #c5b79d;
  --accent: #c39a58;
  --accent-dark: #85622b;
  --success: #4e9d79;
  --danger:  #b3645d;
  --shadow:  0 28px 70px rgba(0, 0, 0, 0.28);

  /* lead-row flag-színek (a sötét háttérre hangolva) */
  --flag-contacted: #6ba6f0;   /* lágyabb kék, nem rikít */
  --flag-proposal:  #e2a64c;
  --flag-progress:  #5cc69a;
  --flag-rejected:  #b3645d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 10%, rgba(195, 154, 88, 0.18), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(88, 133, 114, 0.16), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(195, 154, 88, 0.10), transparent 32%),
    linear-gradient(180deg, #07110d 0%, #0d1c17 48%, #10221b 100%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page-shell {
  position: relative;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.ambient {
  position: fixed;
  width: 340px; height: 340px;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.ambient-left  { top: 80px;  left: -120px; background: rgba(195, 154, 88, 0.18); }
.ambient-right { top: 240px; right: -140px; background: rgba(61, 108, 89, 0.22); }

/* ---------- Header ---------- */
.site-header,
.filters-card,
#leads-zone,
.lead-row {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 0 24px;
  flex-wrap: wrap;
}
.brand-group, .brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 30% 30%, rgba(195, 154, 88, 0.30), transparent 54%),
    rgba(11, 22, 18, 0.96);
  color: var(--accent);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand-copy { display: grid; }
.brand-copy strong {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.brand-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

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

/* ---------- Buttons (pill + arany) ---------- */
button,
.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    background 180ms ease;
}
.button-primary {
  color: #0a120f;
  background: linear-gradient(135deg, #d2ab69 0%, #b4823f 100%);
  box-shadow: 0 14px 32px rgba(180, 130, 63, 0.22);
}
.button-secondary {
  color: var(--text);
  background: rgba(13, 27, 21, 0.74);
  border-color: var(--line-strong);
}
button:hover, .button-primary:hover, .button-secondary:hover {
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Status pill ---------- */
#status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  background: rgba(10, 23, 18, 0.6);
}
.status-loading { color: var(--accent); border-color: var(--line-strong); }
.status-saving  { color: var(--accent); border-color: rgba(195,154,88,0.5); background: rgba(40,28,12,0.5); }
.status-saved   { color: var(--success); border-color: rgba(78,157,121,0.45); background: rgba(14,35,28,0.6); }
.status-error   { color: var(--danger);  border-color: rgba(179,100,93,0.45); background: rgba(40,20,18,0.6); }

/* ---------- Filters ---------- */
.filters-card {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg-soft);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.filters-card input[type="search"] {
  flex: 1; min-width: 18rem;
}
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: rgba(8, 19, 15, 0.78);
  border: 1px solid rgba(195, 154, 88, 0.18);
  border-radius: 14px;
  padding: 10px 14px;
  min-height: 42px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(195, 154, 88, 0.52);
  box-shadow: 0 0 0 3px rgba(195, 154, 88, 0.12);
}
.counter {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: auto;
}

/* ---------- Banner zone (conflict warnings) ---------- */
#banner-zone:empty { display: none; }
#banner-zone .conflict-banner {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: 1px solid rgba(195, 154, 88, 0.4);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(195, 154, 88, 0.08), transparent 30%),
    rgba(40, 28, 12, 0.55);
  color: var(--text);
}
#banner-zone .conflict-banner button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.85rem;
}

/* ---------- Lead list ---------- */
.leads-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.lead-row {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.lead-row:hover { border-color: var(--line-strong); }
.lead-row.dragging { opacity: 0.4; }
.lead-row.has-rejected { opacity: 0.55; }
.lead-row.has-rejected .lead-title { text-decoration: line-through; color: var(--muted); }
.lead-row.expanded {
  border-color: var(--line-strong);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.lead-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
}
.lead-head:hover { background: rgba(196, 167, 108, 0.04); }

.lead-handle {
  color: var(--muted);
  cursor: grab;
  user-select: none;
  padding: 0 0.2rem;
  font-size: 1.1rem;
  letter-spacing: -1px;
}
.lead-handle:active { cursor: grabbing; }

.lead-reorder {
  display: inline-flex;
  gap: 0.05rem;
}
.lead-reorder button {
  min-height: auto;
  padding: 0.2rem 0.45rem;
  font-size: 0.95rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  color: var(--muted);
  font-weight: 500;
  box-shadow: none;
}
.lead-reorder button:hover {
  background: rgba(196, 167, 108, 0.10);
  border-color: var(--line);
  color: var(--text);
  transform: none;
}

.lead-id {
  font-family: "Manrope", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.lead-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--text);
  margin-top: 2px;
}
.lead-title[contenteditable] { outline: none; }
.lead-title[contenteditable]:focus {
  background: rgba(195, 154, 88, 0.10);
  padding: 0.05rem 0.4rem;
  border-radius: 0.4rem;
  box-shadow: 0 0 0 2px rgba(195, 154, 88, 0.25);
}

.lead-final {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(195, 154, 88, 0.08);
}

.lead-owner {
  padding: 0.35rem 0.7rem;
  margin: 0;
  font-size: 0.85rem;
  min-width: 5.5rem;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 19, 15, 0.78);
  color: var(--text);
}

.lead-flags {
  display: flex;
  gap: 0.3rem;
}
.flag {
  cursor: pointer;
  user-select: none;
  border: 1.5px solid transparent;
  border-radius: 0.6rem;
  padding: 0.25rem 0.55rem;
  min-height: auto;
  font-size: 1rem;
  line-height: 1;
  background: rgba(8, 19, 15, 0.5);
  color: var(--muted);
  opacity: 0.45;
  transition: opacity 0.12s, border-color 0.12s, background 0.12s;
  font-weight: 500;
  box-shadow: none;
}
.flag:hover { opacity: 0.85; transform: none; }
.flag.on { opacity: 1; }

.flag[data-flag="contacted"]      { color: var(--flag-contacted); }
.flag[data-flag="contacted"].on   { border-color: var(--flag-contacted); background: rgba(107,166,240,0.14); }
.flag[data-flag="proposal_sent"]  { color: var(--flag-proposal); }
.flag[data-flag="proposal_sent"].on { border-color: var(--flag-proposal); background: rgba(226,166,76,0.14); }
.flag[data-flag="in_progress"]    { color: var(--flag-progress); }
.flag[data-flag="in_progress"].on { border-color: var(--flag-progress); background: rgba(92,198,154,0.14); }
.flag[data-flag="rejected"]       { color: var(--flag-rejected); }
.flag[data-flag="rejected"].on    { border-color: var(--flag-rejected); background: rgba(179,100,93,0.18); }

/* ---------- Lead body (expanded) ---------- */
.lead-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px dashed var(--line);
}
.lead-row.expanded .lead-body { display: block; }
.lead-body textarea {
  width: 100%;
  min-height: 9rem;
  margin-top: 14px;
  font-family: "Manrope", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(8, 19, 15, 0.78);
  resize: vertical;
}
.lead-meta {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 12px;
}
.lead-meta a { color: var(--accent); }

/* ---------- Misc ---------- */
.muted { color: var(--muted); font-size: 0.85rem; }

footer {
  margin-top: 36px;
  padding: 16px;
  text-align: center;
}
footer code {
  font-family: "Manrope", monospace;
  background: rgba(8, 19, 15, 0.6);
  border: 1px solid var(--line);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .lead-head {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "handle reorder title final"
      ".      .       owner owner"
      ".      .       flags flags";
    row-gap: 8px;
  }
  .lead-handle  { grid-area: handle; }
  .lead-reorder { grid-area: reorder; }
  .lead-head > div:has(.lead-title) { grid-area: title; }
  .lead-final   { grid-area: final;  justify-self: end; }
  .lead-owner   { grid-area: owner;  justify-self: start; }
  .lead-flags   { grid-area: flags;  justify-self: start; }

  .filters-card { flex-direction: column; align-items: stretch; }
  .filters-card .counter { margin-left: 0; }
}
