/* A4T Hub — shared styles. Brand tokens from advertising4trades.co.uk
   (same palette as the A4T promo videos). Mobile-first. */
:root {
  --bg-0: #10221c;
  --bg-1: #0d5345;
  --ink: #f6f8f5;
  --muted: #9db8ae;
  --accent: #a8c93e;
  --accent-2: #c8e06b;
  --accent-deep: #8fb02a;
  --pale: #eef6e6;
  --green: #39d36a;
  --green-2: #6fe394;
  --card: #143229;
  --card-2: #1a3f33;
  --line: rgba(255, 255, 255, 0.1);
  --danger: #e66a5c;
  --amber: #e8b84b;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(168, 201, 62, 0.12), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(57, 211, 106, 0.07), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0) 55%) fixed;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }

/* ---- header / nav ---- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  position: sticky; top: 0; z-index: 30;
  background: rgba(13, 38, 31, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: baseline; gap: 7px; font-weight: 900; font-size: 18px; text-decoration: none; color: var(--ink); }
.logo .a4t { color: var(--accent); }
.logo small { color: var(--muted); font-weight: 600; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav button {
  background: none; border: none; color: var(--muted);
  font: inherit; font-weight: 700; font-size: 14px;
  padding: 8px 12px; border-radius: 9px; cursor: pointer;
}
.topbar nav button.active { color: var(--bg-0); background: var(--accent); }
.topbar nav button:not(.active):hover { color: var(--ink); background: var(--card-2); }

/* ---- cards / layout ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 { font-size: 17px; margin-bottom: 12px; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.stat { text-align: left; padding: 16px; }
.stat .num { font-size: 28px; font-weight: 900; color: var(--accent); line-height: 1.1; }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 4px; }

/* ---- forms ---- */
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 10px 0 5px; }
input, select, textarea {
  width: 100%;
  font: inherit; font-size: 15px;
  color: var(--ink);
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; min-height: 80px; }
#demo-banner {
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  color: var(--bg-0); text-align: center;
  font-size: 13.5px; font-weight: 700;
  padding: 9px 16px;
}
#demo-banner a { color: var(--bg-0); font-weight: 800; text-decoration: underline; white-space: nowrap; }

.confirm {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 14px 0 4px; cursor: pointer;
  font-size: 14.5px; font-weight: 700; color: var(--ink);
}
.confirm input[type="checkbox"] {
  width: 20px; height: 20px; flex: none; margin-top: 1px;
  accent-color: var(--accent); cursor: pointer;
}
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 800; font-size: 13.5px;
  color: var(--bg-0); background: var(--accent-2);
  border: none; border-radius: 8px;
  padding: 8px 14px; margin-right: 12px; cursor: pointer;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: 15px;
  color: var(--bg-0);
  background: var(--accent);
  border: none; border-radius: 11px;
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-2); }
.btn.secondary { background: var(--card-2); color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: #225043; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn.small { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- lists & chips ---- */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; font-size: 15px; }
.row .sub { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.click { cursor: pointer; }
.row.click:hover .title { color: var(--accent-2); }

.chip {
  display: inline-block; font-size: 11.5px; font-weight: 800;
  padding: 4px 10px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--card-2); color: var(--muted);
  white-space: nowrap;
}
.chip.new { background: rgba(232, 184, 75, 0.16); color: var(--amber); }
.chip.sent { background: rgba(111, 227, 148, 0.13); color: var(--green-2); }
.chip.accepted, .chip.signed_off { background: rgba(168, 201, 62, 0.2); color: var(--accent-2); }
.chip.declined { background: rgba(230, 106, 92, 0.15); color: var(--danger); }
.chip.planned { background: rgba(232, 184, 75, 0.16); color: var(--amber); }
.chip.in_progress { background: rgba(111, 227, 148, 0.13); color: var(--green-2); }
.chip.complete { background: rgba(168, 201, 62, 0.2); color: var(--accent-2); }

.money { font-weight: 900; color: var(--accent); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 14px; }
.tabs button {
  font: inherit; font-weight: 700; font-size: 14px;
  background: var(--card); color: var(--muted);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 8px 16px; cursor: pointer; white-space: nowrap;
}
.tabs button.active { background: var(--accent); color: var(--bg-0); border-color: transparent; }

/* ---- photo grid ---- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-grid .ph { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--bg-0); }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph .del {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.55); color: #fff; border: none;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 13px;
}

/* ---- toast & misc ---- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(80px);
  background: var(--accent); color: var(--bg-0);
  font-weight: 800; font-size: 14px;
  padding: 12px 22px; border-radius: 99px;
  transition: transform 0.25s ease; z-index: 99;
  max-width: 90vw; text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); color: #fff; }

.note-card { background: var(--bg-0); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.note-card .tag { font-size: 11px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.note-card ul { margin: 6px 0 0 18px; font-size: 14px; }
.note-card details { margin-top: 8px; }
.note-card summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }

.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }

/* ---- AI preview: before/after slider ---- */
.ba { position: relative; border-radius: 14px; overflow: hidden; user-select: none; background: #000; }
.ba > img { width: 100%; display: block; pointer-events: none; }
.ba .ba-after { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.ba .ba-after img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ba .ba-divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: var(--accent); box-shadow: 0 0 12px rgba(0,0,0,0.5); pointer-events: none; }
.ba .ba-divider::after {
  content: "↔"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--bg-0);
  font-size: 16px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.ba input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba .ba-tag {
  position: absolute; top: 10px; z-index: 2; pointer-events: none;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  padding: 3px 10px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.6); color: #fff;
}
.style-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.style-pick button {
  font: inherit; font-weight: 700; font-size: 13.5px;
  background: var(--bg-0); color: var(--muted);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 8px 16px; cursor: pointer;
}
.style-pick button.active { background: var(--accent); color: var(--bg-0); border-color: transparent; }
.spin {
  display: inline-block; width: 16px; height: 16px;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- CRM kanban board ---- */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.board .col {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 180px;
}
.board .col.dragover { border-color: var(--accent); background: rgba(168, 201, 62, 0.07); }
.board .col h3 {
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); display: flex; justify-content: space-between;
  padding: 2px 4px 10px;
}
.lead-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  margin-bottom: 8px;
  cursor: grab;
}
.lead-card:active { cursor: grabbing; }
.lead-card.dragging { opacity: 0.45; }
.lead-card .name { font-weight: 800; font-size: 14.5px; display: flex; gap: 6px; align-items: center; }
.lead-card .meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.lead-card .val { color: var(--accent); font-weight: 800; font-size: 13px; margin-top: 5px; }
.flag { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; }
.flag.hot { background: rgba(230, 106, 92, 0.18); color: #ff9d92; }
.flag.stale { background: rgba(232, 184, 75, 0.16); color: var(--amber); }
.flag.due { background: rgba(111, 227, 148, 0.14); color: var(--green-2); }

@media print {
  body { background: #fff; color: #111; }
  .no-print { display: none !important; }
}
