/* Admin + booth app only. Shared tokens/components live in style.css. */
body:not(.admin) [data-admin], body:not(.super) .c-brand { display: none !important; }

/* login */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 0% -10%, color-mix(in srgb, var(--red) 13%, transparent), transparent 65%),
    radial-gradient(900px 500px at 100% 110%, color-mix(in srgb, var(--blue) 15%, transparent), transparent 65%),
    var(--bg);
}
.login-card { width: min(420px, 100%); padding: 34px 28px 28px; box-shadow: 0 24px 60px rgba(25, 25, 50, .08); }
.login-card h1 { margin-bottom: 4px; }
.login-card > p.muted { margin: 0 0 22px; }
.login-logo { height: 34px; display: block; margin-bottom: 26px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top::before { content: ''; display: block; height: 3px; background: var(--grad); }
.top-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 8px 20px; min-height: 62px; }
.logo-link { display: flex; flex: none; }
.logo { height: 28px; width: auto; max-width: 160px; object-fit: contain; }
#brandSel { width: auto; max-width: 200px; padding: 7px 10px; font-size: 16px; font-weight: 600; border-radius: 9px; }
.tabs { display: flex; gap: 2px; margin-left: 6px; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 10px; color: var(--muted); font-weight: 700; text-decoration: none; font-size: .95rem; position: relative; }
.tabs a:hover { color: var(--ink); background: #f2f3f7; }
.tabs a[aria-current=page] { color: var(--ink); background: #f2f3f7; }
.tabs a[aria-current=page] svg { stroke: var(--c1); }
.tabs svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.acct { margin-left: auto; background: none; padding: 4px; gap: 10px; border-radius: 999px; }
.who { text-align: right; line-height: 1.2; }
.who b { display: block; font-size: .92rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .88rem; flex: none; }

main { max-width: 1200px; margin: 0 auto; padding: 26px 20px 48px; }
.narrow { max-width: 720px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 10px; }

/* capture */
.cap-head { margin-bottom: 12px; padding: 16px 18px; }
.cap-head select { font-weight: 700; }
.cap-count { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 0; }
.cap-count b { font-family: 'Space Grotesk', sans-serif; font-size: 1.7rem; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cap-form input, .cap-form textarea { font-size: 17px; padding: 14px; }
.cap-form #f-name { font-size: 19px; font-weight: 600; }
.hint-top { margin: -8px 0 14px; }
.cap-form .big { margin-top: 6px; }

/* leads */
.filters { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.filters input, .filters select { padding: 10px 12px; }
@media (max-width: 960px) { .filters { grid-template-columns: 1fr 1fr; } .filters .q { grid-column: 1 / -1; } }
.stats { margin-bottom: 14px; }
.stat.hot b { color: var(--hot); } .stat.warm b { color: #b45309; } .stat.cold b { color: var(--cold); } .stat.qr b { color: #6b2a9e; }

.card.flush { padding: 0; overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; background: #fbfbfd; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl.click tbody tr { cursor: pointer; }
.tbl.click tbody tr:hover, .tbl.click tbody tr:focus-visible { background: #f8f9fc; outline: none; }
.tbl td a { text-decoration: none; font-weight: 600; }
.tbl .sub { color: var(--muted); font-size: .85rem; }
.tbl .tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tbl td.c-act { text-align: right; white-space: nowrap; }
.tbl td.c-act button + button { margin-left: 6px; }
.tag.s-contacted { background: #e8f2fc; color: var(--blue); } .tag.s-qualified { background: #f1e9fa; color: #6b2a9e; }
.tag.s-converted, .tag.live { background: #e7f6ee; color: var(--ok); } .tag.s-lost { background: #f2f2f2; color: #8a8d96; }

@media (max-width: 760px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { padding: 14px 16px; border-bottom: 1px solid var(--line); position: relative; }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { padding: 2px 0; border: 0 !important; }
  .tbl td:first-child { padding-right: 96px; }
  .tbl td.c-time { position: absolute; top: 15px; right: 16px; font-size: .78rem; }
  .tbl td.c-event { font-size: .82rem; }
  .tbl td.c-rating, .tbl td.c-status { display: inline-block; margin: 6px 6px 0 0; }
  .tbl td.c-act { text-align: left; padding-top: 8px; }
}

/* events */
.ev { display: flex; flex-direction: column; }
.ev.closed { background: #fbfbfc; }
.ev .row.spread { flex-wrap: nowrap; align-items: flex-start; }
.ev h3 { font-size: 1.15rem; }
.ev .meta { margin: 6px 0 0; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.mini div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.mini b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; line-height: 1.15; }
.mini span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.ev .actions { margin-top: auto; gap: 8px; }

/* brands */
.brand-logo { height: 76px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; margin-bottom: 14px; padding: 12px; }
.brand-logo img { max-height: 52px; max-width: 100%; object-fit: contain; }
.brand-logo.none { color: var(--muted); font-size: .85rem; }
.swatches { display: flex; gap: 6px; align-items: center; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.logo-edit { display: grid; gap: 10px; }
.logo-edit .brand-logo { margin: 0; height: 70px; }
.logo-edit > div:last-child { display: flex; gap: 8px; align-items: center; }
.logo-edit input[type=file] { padding: 8px; font-size: .9rem; }

/* dialog */
#dlg { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); box-shadow: 0 30px 80px rgba(20, 20, 40, .25); color: var(--ink); background: #fff; }
#dlg::backdrop { background: rgba(20, 22, 35, .45); }
.dlg-in { padding: 18px 22px 22px; outline: none; }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dlg-head h2 { padding-top: 4px; word-break: break-word; }
.x { background: none; padding: 2px 8px; font-size: 1.6rem; line-height: 1; color: var(--muted); font-weight: 400; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.dlg-foot .left { margin-right: auto; }
@media (max-width: 560px) {
  #dlg { width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .dlg-in { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
.hint { margin: 6px 0 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; margin: 0 0 18px; }
.kv dt { color: var(--muted); font-size: .85rem; font-weight: 600; padding-top: 1px; }
.kv dd { margin: 0; word-break: break-word; }
.kv a { font-weight: 600; text-decoration: none; }
.qr img { width: 100%; max-width: 320px; aspect-ratio: 1; display: block; margin: 0 auto 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.copy-row { display: flex; gap: 8px; margin-bottom: 12px; }
.copy-row input { font-size: 15px; padding: 10px 12px; }

/* phone: tabs become a bottom nav */
@media (max-width: 760px) {
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; } /* a filter would trap the fixed bottom nav inside the header */
  .top-in { padding: 8px 16px; min-height: 54px; gap: 10px; }
  #v-leads .stats { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  #v-leads .stat { padding: 8px 6px; text-align: center; }
  #v-leads .stat b { font-size: 1.25rem; }
  #v-leads .stat span { font-size: .7rem; }
  .logo { height: 24px; max-width: 120px; }
  #brandSel { max-width: 150px; min-width: 0; }
  .who { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 0; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabs a { flex: 1; flex-direction: column; gap: 3px; font-size: .72rem; padding: 6px 2px; }
  .tabs a[aria-current=page] { background: transparent; color: var(--c1); }
  .tabs svg { width: 22px; height: 22px; }
  main { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.4rem; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .cap-head, .cap-form { padding: 16px; }
}
