/* Firefly CRM — shared styles. Lime #9ED500 / charcoal #1a1a1a, Archivo + system. */
:root {
  --ff-lime: #9ED500;
  --ff-lime-dark: #7fab00;
  --ff-charcoal: #1a1a1a;
  --ff-coral: #ff6b5e;
  --ff-bg: #f5f6f3;
  --ff-card: #ffffff;
  --ff-border: #e3e5df;
  --ff-muted: #6b6f68;
  --ff-radius: 10px;
  --ff-shadow: 0 1px 3px rgba(26, 26, 26, 0.08), 0 4px 16px rgba(26, 26, 26, 0.04);
  --ff-font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ff-font);
  background: var(--ff-bg);
  color: var(--ff-charcoal);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ff-lime-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top bar ─────────────────────────────────────────── */
.ff-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ff-charcoal);
  color: #fff;
  padding: 0.85rem 1.5rem;
}
.ff-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #fff;
}
.ff-brand .dot {
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  background: var(--ff-lime); box-shadow: 0 0 10px var(--ff-lime);
}
.ff-topbar a, .ff-topbar button { color: #fff; }
.ff-topbar-actions { display: flex; gap: 0.75rem; align-items: center; }

/* ── Layout ──────────────────────────────────────────── */
.ff-container { max-width: 980px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.ff-container.narrow { max-width: 680px; }

h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.25rem; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 1.75rem 0 0.75rem; }
.ff-sub { color: var(--ff-muted); margin: 0 0 1.5rem; }

/* ── Cards ───────────────────────────────────────────── */
.ff-card {
  background: var(--ff-card);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

/* ── Forms ───────────────────────────────────────────── */
label { display: block; font-weight: 600; font-size: 0.82rem; margin-bottom: 0.3rem; }
.ff-field { margin-bottom: 1rem; }
input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--ff-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--ff-charcoal);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ff-lime);
  box-shadow: 0 0 0 3px rgba(158, 213, 0, 0.2);
}
.ff-grid { display: grid; gap: 1rem; }
.ff-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.ff-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .ff-grid.cols-2, .ff-grid.cols-3 { grid-template-columns: 1fr; } }

.ff-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.ff-check input { width: auto; }

/* ── Buttons ─────────────────────────────────────────── */
.ff-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border: none; border-radius: 8px;
  background: var(--ff-lime); color: var(--ff-charcoal);
  font-family: inherit; font-weight: 700; font-size: 0.92rem;
  cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.ff-btn:hover { background: var(--ff-lime-dark); }
.ff-btn:active { transform: translateY(1px); }
.ff-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ff-btn.secondary { background: #fff; border: 1px solid var(--ff-border); color: var(--ff-charcoal); }
.ff-btn.secondary:hover { background: var(--ff-bg); }
.ff-btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,0.3); }

/* ── Tables ──────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.7rem 0.65rem; border-bottom: 1px solid var(--ff-border); }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ff-muted); }
tbody tr:hover { background: rgba(158, 213, 0, 0.06); cursor: pointer; }

/* ── Misc ────────────────────────────────────────────── */
.ff-pill {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  background: rgba(158, 213, 0, 0.18); color: var(--ff-lime-dark);
}
.ff-pill.lead { background: #eef0ec; color: var(--ff-muted); }
.ff-pill.won { background: rgba(158,213,0,0.2); color: var(--ff-lime-dark); }
.ff-pill.lost { background: rgba(255,107,94,0.15); color: var(--ff-coral); }

.ff-metric {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.9rem 1rem; background: var(--ff-bg); border-radius: 8px;
}
.ff-metric .v { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.ff-metric .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ff-muted); }

.ff-error {
  background: rgba(255, 107, 94, 0.1); border: 1px solid var(--ff-coral);
  color: #b3271a; padding: 0.7rem 0.9rem; border-radius: 8px;
  font-size: 0.88rem; margin-bottom: 1rem;
}
.ff-error:empty { display: none; }
.ff-note { color: var(--ff-muted); font-size: 0.85rem; }
.ff-loading { color: var(--ff-muted); padding: 2rem 0; text-align: center; }

.ff-readonly {
  background: var(--ff-bg); border: 1px solid var(--ff-border);
  border-radius: 8px; padding: 0.6rem 0.8rem; font-size: 0.92rem;
}
.ff-kw-readout {
  display: flex; gap: 1.5rem; padding: 0.9rem 1.1rem;
  background: var(--ff-charcoal); color: #fff; border-radius: 8px; margin-top: 0.5rem;
}
.ff-kw-readout .v { color: var(--ff-lime); font-weight: 800; font-size: 1.25rem; }
.ff-kw-readout .k { font-size: 0.72rem; text-transform: uppercase; opacity: 0.7; display: block; }

.ff-otherload-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.ff-string-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.ff-otherload-row input, .ff-string-row input { margin: 0; }
.ff-row-del { background: transparent; border: 1px solid var(--ff-border); border-radius: 6px; cursor: pointer; padding: 0.4rem; }
