/* Creators Conclave CRM — black and gold like the website, built for phones first. */

:root {
  --bg: #0a0a0a;
  --panel: #131313;
  --panel-2: #1b1b1b;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f3eee4;
  --muted: #9c9483;
  --gold: #ebbe6f;
  --gold-2: #c48f46;
  --teal: #6fc6d3;
  --danger: #ef7d6b;
  --s-new: #ebbe6f;
  --s-contacted: #6fc6d3;
  --s-interested: #b49cf0;
  --s-confirmed: #7fd49a;
  --s-won: #3fd18b;
  --s-lost: #7d7d7d;
  --radius: 14px;
  --nav-w: 232px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { opacity: .8; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ── Controls ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: rgba(235, 190, 111, .5); text-decoration: none; }
.btn--gold { background: linear-gradient(135deg, #f5d899, var(--gold) 45%, var(--gold-2)); color: #161109; border: 0; }
.btn--gold:hover { filter: brightness(1.06); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); border-color: rgba(239, 125, 107, .35); background: transparent; }
.btn--sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn--wa { color: #5fd38a; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #0e0e0e; outline: none; }
textarea.input { min-height: 92px; resize: vertical; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(235, 190, 111, .15); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ── Sign-in screens ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(60% 50% at 50% 0%, rgba(235, 190, 111, .12), transparent 70%), var(--bg); }
.auth__card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; }
.auth__logo { display: block; width: 200px; height: auto; margin: 0 auto 6px; }
.auth__tag { text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 22px; }
.auth h1 { font-size: 20px; margin-bottom: 6px; }
.auth p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.auth .btn { width: 100%; margin-top: 4px; }

/* ── Shell: side menu on wide screens, tab bar on phones ── */
.shell { min-height: 100vh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: rgba(12, 12, 12, .96);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.nav .nav__brand, .nav__me, .nav__label-wide { display: none; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 10px; }
.nav a svg { width: 22px; height: 22px; }
.nav a:hover { text-decoration: none; color: var(--text); }
.nav a.is-on { color: var(--gold); }
.main { max-width: 1280px; margin: 0 auto; padding: 18px 16px 32px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top__sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.mobile-brand { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 14px; }
.mobile-brand img { width: 150px; height: auto; }

@media (min-width: 900px) {
  .shell { padding: 0 0 0 var(--nav-w); }
  .nav { top: 0; right: auto; width: var(--nav-w); flex-direction: column; justify-content: flex-start; gap: 2px; padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line); background: #0d0d0d; }
  .nav a.nav__brand { display: block; padding: 0 8px 22px; }
  .nav a.nav__brand:hover { background: none; }
  .nav__brand img { width: 172px; height: auto; display: block; }
  .nav__brand span { display: block; margin-top: 6px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
  .nav a { flex: none; flex-direction: row; gap: 12px; padding: 10px 12px; font-size: 14px; }
  .nav a.is-on { background: rgba(235, 190, 111, .1); }
  .nav__label-wide { display: inline; }
  .nav__label-short { display: none; }
  .nav__me { display: block; margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
  .nav__me b { display: block; color: var(--text); }
  .nav__me button { margin-top: 8px; background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
  .nav__me button:hover { color: var(--gold); }
  .main { padding: 28px 32px 48px; }
  .mobile-brand { display: none; }
}

/* ── Panels ── */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel__head a { font-size: 13px; }
.grid { display: grid; gap: 14px; }
.grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .grid--kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grid--wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.kpi { display: block; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
a.kpi:hover { border-color: rgba(235, 190, 111, .45); text-decoration: none; }
.kpi__label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi__num { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi__num--gold { color: var(--gold); }
.kpi__note { color: var(--muted); font-size: 12.5px; }

/* Bars and the 30-day chart */
.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: minmax(84px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; color: var(--text); }
a.bar:hover { text-decoration: none; color: var(--gold); }
.bar__track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); min-width: 3px; }
.bar__n { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 28px; text-align: right; }
.bar__k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.bar__k--path { text-transform: none; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pipe { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .05); margin-bottom: 12px; }
.pipe span { display: block; height: 100%; }
.pipe-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pipe-key { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); padding: 6px 8px; border-radius: 8px; }
a.pipe-key:hover { background: rgba(255, 255, 255, .04); text-decoration: none; }
.pipe-key b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Badges */
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .06); white-space: nowrap; }
.pill--status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-new { color: var(--s-new); } .s-contacted { color: var(--s-contacted); } .s-interested { color: var(--s-interested); }
.s-confirmed { color: var(--s-confirmed); } .s-won { color: var(--s-won); } .s-lost { color: var(--s-lost); }
.bg-new { background: var(--s-new); } .bg-contacted { background: var(--s-contacted); } .bg-interested { background: var(--s-interested); }
.bg-confirmed { background: var(--s-confirmed); } .bg-won { background: var(--s-won); } .bg-lost { background: var(--s-lost); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.tag--type { color: var(--text); }

/* Lists of people */
.people { display: grid; gap: 2px; }
.person { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 8px; border-radius: 10px; color: var(--text); }
a.person:hover { background: rgba(255, 255, 255, .04); text-decoration: none; }
.person__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__meta { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); font-size: 14px; padding: 18px 8px; text-align: center; }

/* ── Leads list ── */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.filters .input { min-height: 40px; }
.filters__search { grid-column: 1 / -1; }
.filters__check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin: 0; padding: 0 4px; cursor: pointer; }
.filters__check input { accent-color: var(--gold); width: 18px; height: 18px; }
@media (min-width: 900px) { .filters { grid-template-columns: 2.2fr repeat(5, 1fr) auto; } .filters__search { grid-column: auto; } }
.count { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.is-link { cursor: pointer; }
.table tr.is-link:hover td { background: rgba(255, 255, 255, .03); }
.table .who b { display: block; }
.table .who span { color: var(--muted); font-size: 13px; }
.table .acts { display: flex; gap: 6px; }
.table .acts .icon-btn { width: 32px; height: 32px; }
.table .acts .icon-btn svg { width: 15px; height: 15px; }
.table-wrap { overflow-x: auto; }
.cards { display: grid; gap: 10px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--text); }
.card:hover { text-decoration: none; border-color: var(--line-2); }
.card__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.card__name { font-weight: 700; font-size: 16px; }
.card__meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card__foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.only-wide { display: none; }
@media (min-width: 900px) { .only-wide { display: block; } .only-narrow { display: none; } .board { grid-auto-columns: minmax(176px, 1fr); } }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 14px; }

/* ── One lead ── */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.back svg { width: 16px; height: 16px; }
.lead-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 16px; }
.lead-head h1 { font-size: 26px; word-break: break-word; }
.lead-head__meta { color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.stages { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.stage { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.stage:hover { color: var(--text); }
.stage.is-on { color: #111; border-color: transparent; }
.stage.bg-new { background: var(--s-new); } .stage.bg-contacted { background: var(--s-contacted); } .stage.bg-interested { background: var(--s-interested); }
.stage.bg-confirmed { background: var(--s-confirmed); } .stage.bg-won { background: var(--s-won); } .stage.bg-lost { background: var(--s-lost); }
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (min-width: 700px) { .controls { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.controls label { margin-bottom: 4px; }
.kinds { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.kind { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 13px; color: var(--muted); }
.kind.is-on { border-color: var(--gold); color: var(--gold); background: rgba(235, 190, 111, .08); }
.timeline { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 0; }
.tl { position: relative; padding: 0 0 18px 28px; }
.tl::before { content: ''; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.tl:last-child::before { display: none; }
.tl__dot { position: absolute; left: 0; top: 3px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); }
.tl__dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.tl--form .tl__dot i { background: var(--gold); }
.tl--note .tl__dot i, .tl--call .tl__dot i, .tl--whatsapp .tl__dot i, .tl--email .tl__dot i, .tl--meeting .tl__dot i { background: var(--teal); }
.tl__head { font-size: 13px; color: var(--muted); }
.tl__head b { color: var(--text); font-weight: 600; }
.tl__body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.answers { margin: 8px 0 0; display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px 12px; font-size: 14px; background: var(--panel-2); border-radius: 10px; padding: 12px; }
.answers dt { color: var(--muted); }
.answers dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.facts { display: grid; grid-template-columns: minmax(96px, 36%) 1fr; gap: 8px 12px; font-size: 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.visit { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.visit:last-child { border-bottom: 0; }
.visit span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side { display: grid; gap: 14px; align-content: start; }

/* ── Pipeline board ── */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 140px; }
.col.is-drop { border-color: var(--gold); background: rgba(235, 190, 111, .05); }
.col__head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.col__head b { margin-left: auto; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.col__list { display: grid; gap: 8px; }
.ticket { display: block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); cursor: grab; }
.ticket:hover { border-color: var(--line-2); text-decoration: none; }
.ticket.is-dragging { opacity: .5; }
.ticket__name { font-weight: 600; font-size: 14px; }
.ticket__meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Team ── */
.invite-link { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.invite-link code { flex: 1 1 260px; min-width: 0; padding: 9px 12px; border-radius: 10px; background: #0e0e0e; border: 1px dashed rgba(235, 190, 111, .5); font-size: 12.5px; word-break: break-all; color: var(--gold); }

/* ── Toast ── */
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #1f1a10; color: var(--gold);
  border: 1px solid rgba(235, 190, 111, .4); padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: calc(100vw - 32px); }
.toast.is-error { color: var(--danger); border-color: rgba(239, 125, 107, .45); background: #1e1210; }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + var(--nav-w) / 2); } }

/* ── Dialog ── */
.dialog { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); }
.dialog__card { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; }
.dialog__card h2 { font-size: 18px; margin-bottom: 14px; }
.dialog__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
