/* MARQORA admin panel */
@font-face { font-family: 'Outfit'; src: url('/assets/fonts/outfit-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0b0b0d; --panel: #121215; --card: #17181c; --card-2: #1e1f24; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
  --text: #f2f2f3; --text-2: #c2c3c8; --text-3: #8b8d94; --muted: #6b6d74;
  --red: #7c4dff; --red-hot: #9b72ff; --red-soft: rgba(124,77,255,.16);
  --green: #2fbf71; --amber: #f5a524; --blue: #4c8dff; --violet: #9b7bff;
  --r: 14px; --r-lg: 20px;
  --font-display: 'Outfit', 'Helvetica Neue', Arial, sans-serif; --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mark { width: 100%; height: auto; }
.mark-l, .mark-d { fill: #f2f2f2; } .mark-v { fill: var(--red); } .mark-r { fill: #7b7e85; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 54px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.94); } }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; transition: background-color .2s, border-color .2s, opacity .2s; }
.btn:hover { background: rgba(255,255,255,.09); }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-hot); }
.btn--danger { color: #ff8a80; border-color: rgba(255,90,78,.35); }
.btn--danger:hover { background: rgba(255,90,78,.12); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn--icon { width: 36px; padding: 0; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field small.hint { color: var(--text-3); font-size: 12px; }
.input, .field input[type='text'], .field input[type='email'], .field input[type='password'], .field input[type='url'], .field input[type='number'], .field input[type='tel'], .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #0e0e11; color: var(--text); font-size: 14px;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--red-hot); box-shadow: 0 0 0 3px rgba(124,77,255,.22); }
.field input[type='color'] { width: 56px; height: 42px; padding: 4px; border-radius: 10px; border: 1px solid var(--line-2); background: #0e0e11; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: #ff5a4e; }
.field-error { color: #ff7a70; font-size: 12.5px; }
.field-error:empty { display: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.full { grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #2a2b31; transition: background-color .2s; flex: none; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #cfd0d4; transition: transform .25s; }
.switch input:checked + .switch-ui { background: var(--red); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--red-hot); outline-offset: 2px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 50% 0%, rgba(124,77,255,.22), transparent 70%); }
.login-card { width: 100%; max-width: 400px; padding: 32px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 40px 80px -40px rgba(0,0,0,.8); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .mark { width: 34px; }
.brand-name { font-family: var(--font-display); font-weight: 600; letter-spacing: .3em; font-size: 16px; }
.brand-sub { font-size: 10px; letter-spacing: .3em; color: var(--text-3); text-transform: uppercase; }
.login h1 { font-family: var(--font-display); font-weight: 500; font-size: 26px; letter-spacing: -.02em; margin-bottom: 4px; }
.login p.lede { color: var(--text-3); margin-bottom: 22px; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login .btn { height: 46px; margin-top: 6px; }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--red-soft); color: #ffb3ad; font-size: 13.5px; }
.alert--info { background: rgba(76,141,255,.12); color: #b7cdff; }
.alert--warn { background: rgba(245,165,36,.12); color: #ffd28a; }

/* shell */
.shell { display: grid; grid-template-columns: 248px minmax(0,1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 14px; background: var(--panel); border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 20px; border-bottom: 1px solid var(--line); margin-bottom: 10px; text-decoration: none; }
.side-brand .mark { width: 26px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text-2); font-weight: 500; transition: background-color .2s, color .2s; }
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item.is-active { background: var(--red-soft); color: #fff; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.side-user { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.side-user strong { display: block; color: var(--text); }
.topbar { display: none; }
.main { min-width: 0; padding: 30px clamp(16px, 3vw, 40px) 60px; }
.main:focus, .main:focus-visible { outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.page-head h1 { font-family: var(--font-display); font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.page-head p { color: var(--text-3); margin-top: 2px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; gap: 6px; color: var(--text-3); text-decoration: none; font-size: 13px; margin-bottom: 8px; }
.back:hover { color: var(--text); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 14px; letter-spacing: -.01em; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.stat { padding: 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); text-decoration: none; display: block; }
.stat:hover { border-color: var(--line-2); }
.stat-label { color: var(--text-3); font-size: 12.5px; }
.stat-value { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; }
.stat-sub { color: var(--text-3); font-size: 12.5px; }
.stat--accent { background: linear-gradient(160deg, rgba(124,77,255,.24), var(--card) 70%); border-color: rgba(124,77,255,.35); }

.chart { width: 100%; height: 190px; }
.chart text { fill: var(--text-3); font-size: 10px; font-family: var(--font-body); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .bar-label { grid-column: 1 / -1; color: var(--text-2); display: flex; justify-content: space-between; }
.bar-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; grid-column: 1 / -1; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--red); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover .li-title { color: var(--red-hot); }
.li-title { font-weight: 600; }
.li-sub { color: var(--text-3); font-size: 12.5px; }

/* tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar .input { max-width: 300px; }
.toolbar select.input { max-width: 200px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; background: rgba(255,255,255,.02); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background-color .15s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.03); }
.tbl .muted { color: var(--text-3); font-size: 12.5px; }
.tbl a { text-decoration: none; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; color: var(--text-3); font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; color: var(--text-3); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.07); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--new { background: var(--red-soft); color: #ff8a80; }
.pill--contacted, .pill--read { background: rgba(76,141,255,.14); color: #9dbcff; }
.pill--proposal_sent { background: rgba(155,123,255,.14); color: #c4b1ff; }
.pill--won, .pill--replied { background: rgba(47,191,113,.14); color: #7be0a8; }
.pill--lost { background: rgba(255,255,255,.06); color: var(--text-3); }
.pill--archived { background: rgba(255,255,255,.04); color: var(--muted); }

dl.kv { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 10px 16px; margin: 0; }
dl.kv dt { color: var(--text-3); font-size: 13px; }
dl.kv dd { margin: 0; word-break: break-word; }
.svc-items { display: flex; flex-direction: column; gap: 8px; }
.svc-item { padding: 12px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.svc-item strong { display: block; }
.svc-item span { color: var(--text-3); font-size: 12.5px; }
.svc-item small { color: var(--red-hot); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-2); }
.message-body { white-space: pre-wrap; line-height: 1.65; padding: 16px; border-radius: 12px; background: var(--card-2); }

/* projects */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { border-radius: var(--r-lg); overflow: hidden; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; }
.pcard-media { aspect-ratio: 3/2; background: var(--card-2); position: relative; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; }
.pcard-media .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge { padding: 4px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.15); }
.badge--draft { background: rgba(245,165,36,.85); color: #111; border-color: transparent; }
.pcard-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard-title { font-weight: 600; font-size: 15px; }
.pcard-meta { color: var(--text-3); font-size: 12.5px; }
.pcard-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.pcard-toggles { display: flex; gap: 14px; font-size: 12.5px; }

.dropzone { position: relative; border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--text-3); transition: border-color .2s, background-color .2s; }
.dropzone.is-over { border-color: var(--red-hot); background: var(--red-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cover-preview { margin-top: 10px; border-radius: 12px; overflow: hidden; aspect-ratio: 3/2; background: var(--card-2); max-width: 360px; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.media-row { display: grid; grid-template-columns: 96px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.media-thumb { width: 96px; aspect-ratio: 3/2; border-radius: 8px; overflow: hidden; background: #000; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-actions { display: flex; gap: 6px; }
.pending-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hl-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr) auto; gap: 8px; margin-bottom: 8px; }
.progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 10px; }
.progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; margin-top: 16px; background: linear-gradient(transparent, var(--bg) 35%); }

.svc-admin { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr) 90px auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.svc-admin:last-child { border-bottom: 0; }
.addon-admin { display: grid; grid-template-columns: minmax(0,1.4fr) 140px 170px; gap: 10px 12px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.addon-admin:last-child { border-bottom: 0; }
.addon-admin-wide { grid-column: span 2; }
.addon-admin-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 18px; }
.card h2 .muted { color: var(--text-3); font-weight: 400; font-size: 0.82em; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100% - 40px); }
.toast { padding: 12px 16px; border-radius: 12px; background: #1f2025; border: 1px solid var(--line-2); box-shadow: 0 20px 40px -20px #000; animation: tin .3s ease; }
.toast--error { border-color: rgba(255,90,78,.5); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats > :first-child { grid-column: 1 / -1; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .3s ease; }
  .shell.nav-open .side { transform: none; box-shadow: 40px 0 80px rgba(0,0,0,.6); }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 40; padding: 12px 16px; background: rgba(18,18,21,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .topbar .mark { width: 22px; }
  .main { padding-top: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 10px; }
  .svc-admin { grid-template-columns: 1fr; }
  .addon-admin { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .addon-admin > .field:first-child, .addon-admin-wide { grid-column: 1 / -1; }
  .addon-admin-actions { justify-content: flex-start; }
  .media-row { grid-template-columns: 72px minmax(0,1fr); }
  .media-thumb { width: 72px; }
  .media-actions { grid-column: 1 / -1; }
  .hl-row { grid-template-columns: 1fr 1fr auto; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 26px; }
  .toolbar .input, .toolbar select.input { max-width: none; flex: 1 1 100%; }
}

/* ---------------------------------------------------- caller portal */
.code-input { font-size: 20px; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.earn { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: radial-gradient(120% 140% at 0% 0%, rgba(124,77,255,.22), transparent 60%), var(--card); }
.earn-value { font-family: var(--font-display); font-size: clamp(40px, 7vw, 64px); font-weight: 700; line-height: 1.05; margin: 6px 0 10px; background: linear-gradient(90deg, #fff, #b9a4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.earn-split { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 10px; color: var(--text-2); }
.earn-split strong { color: var(--text); }
.earn-ring { text-align: center; max-width: 220px; }
.earn-ring p { color: var(--text-2); font-size: 13px; margin-top: 8px; }
.ring { width: 150px; height: 150px; margin: 0 auto; }
.ring-fill { transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1); }
.ring-fill.is-in { stroke-dashoffset: var(--to); }
.ring-num { fill: var(--text); font: 700 26px var(--font-display); }
.ring-sub { fill: var(--text-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.bar-grow { transform-box: fill-box; transform-origin: bottom; animation: barGrow .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes barGrow { from { transform: scaleY(0); } }
.search-card .grid-3 { align-items: end; }
.lead { margin-bottom: 14px; transition: opacity .3s, transform .3s; }
.lead.is-done { opacity: 0; transform: translateX(24px); }
.lead-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.lead-head h3 { font: 600 18px var(--font-display); margin: 0 0 4px; }
.lead-call { white-space: nowrap; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; color: var(--text-2); font-size: 13px; }
.lead-meta a { color: var(--violet); }
.lead-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lead-cols h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.weak, .tips { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; }
.weak li::marker { color: var(--amber); }
.tips li::marker { color: var(--green); }
.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lead-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn--ok { background: var(--green); border-color: var(--green); color: #06180e; }
.booking-status { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.booking-status p { margin-top: 6px; }
.muted { color: var(--text-3); }
@media (max-width: 760px) {
  .earn { grid-template-columns: 1fr; }
  .earn-ring { max-width: none; }
  .lead-cols { grid-template-columns: 1fr; }
  .lead-call { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .bar-grow { animation: none; } .ring-fill, .lead { transition: none; } }
