/* SPARK app (admin + client area). base.css holds the landing page's tokens, buttons, type and form styles. */
@font-face { font-family: "Horev"; src: url(horev.ttf) format("truetype"); font-weight: 900; font-display: swap; }

* { box-sizing: border-box; }
html { background: var(--void); }
body { margin: 0; min-height: 100svh; background: var(--void); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }

/* Backdrop: the landing page's glow and synthwave floor, kept still so screens stay calm. */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(80% 60% at 70% -10%, rgba(126, 48, 255, .28), transparent 60%), radial-gradient(60% 50% at 0% 110%, rgba(255, 46, 126, .14), transparent 60%); }
.bg::after { content: ""; position: absolute; inset: 62% -40% -20%; transform: perspective(420px) rotateX(64deg); transform-origin: top;
  background-image: linear-gradient(rgba(236, 170, 255, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 170, 255, .16) 1px, transparent 1px);
  background-size: 70px 70px; mask-image: linear-gradient(transparent, #000 40%); -webkit-mask-image: linear-gradient(transparent, #000 40%); }
.app { position: relative; z-index: 1; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 6px; padding: 22px 16px; border-inline-end: 1px solid rgba(170, 70, 255, .18); background: rgba(11, 1, 24, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.side .brand { margin: 0 8px 22px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--muted); text-decoration: none; font-weight: 600; position: relative; }
.nav-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-link:hover { color: var(--ink); background: rgba(170, 70, 255, .1); }
.nav-link.on { color: #fff; background: linear-gradient(180deg, rgba(168, 77, 255, .35), rgba(111, 30, 232, .3)); box-shadow: inset 0 0 0 1px rgba(236, 170, 255, .25), 0 0 22px rgba(140, 40, 255, .3); }
.side-foot { margin-top: auto; display: grid; gap: 10px; font-size: 13px; color: var(--muted); }
.side-foot .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 8px; }
.main { min-width: 0; padding: 26px clamp(16px, 3vw, 40px) 60px; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; box-shadow: 0 0 12px rgba(255, 46, 126, .7); margin-inline-start: auto; }
.count:empty, .count[data-n="0"] { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto 0 0; top: auto; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); border: 0; border-top: 1px solid rgba(170, 70, 255, .25); z-index: 30; gap: 0; }
  .side .brand, .side-foot { display: none; }
  .nav-link { flex-direction: column; gap: 3px; padding: 7px 10px; font-size: 12px; }
  .nav-link .count { position: absolute; top: 2px; inset-inline-end: 8px; margin: 0; }
  .main { padding-bottom: 110px; }
}

/* ---------- page head ---------- */
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.head h1 { font-size: clamp(42px, 5vw, 68px); line-height: .95; display: flex; flex-wrap: wrap; gap: .1em .25em; align-items: baseline; }
.head .eyebrow { margin-bottom: 10px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- cards ---------- */
.card { position: relative; border-radius: 24px; padding: 20px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 18px 50px rgba(0, 0, 0, .25); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.card.rim { box-shadow: inset 0 0 0 1.5px rgba(170, 70, 255, .7), 0 0 26px rgba(130, 20, 230, .35); }
.card h3 { font: 900 26px/1 var(--f-cap); color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .cap { font-size: 38px; display: block; margin-bottom: 8px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--lilac); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-danger { background: rgba(255, 46, 126, .12); box-shadow: inset 0 0 0 1.5px rgba(255, 46, 126, .5); color: #ffc2d6; }
.btn-wa { background: linear-gradient(180deg, #2be37b, #12a957); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 8px 26px rgba(30, 200, 110, .35); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- filters / tabs ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(8, 0, 20, .55); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 9px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.tabs button.on { color: #fff; background: linear-gradient(180deg, #a84dff, #6f1ee8); box-shadow: 0 0 16px rgba(170, 70, 255, .5); }
.tabs .count { margin: 0; }

/* ---------- leads ---------- */
.lead-card { display: grid; gap: 10px; }
.lead-card.new { box-shadow: inset 0 0 0 1.5px rgba(255, 46, 126, .6), 0 0 26px rgba(255, 46, 126, .2); }
.lead-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.lead-name { font: 900 30px/1 var(--f-cap); color: #fff; }
.lead-msg { background: rgba(8, 0, 20, .5); border-radius: 14px; padding: 10px 14px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: rgba(8, 0, 20, .6); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.pill.new { color: #ffc2d6; box-shadow: inset 0 0 0 1px rgba(255, 46, 126, .6); }
.pill.contacted { color: #ffe3a3; box-shadow: inset 0 0 0 1px rgba(255, 200, 80, .5); }
.pill.converted { color: #a9ffc9; box-shadow: inset 0 0 0 1px rgba(60, 220, 130, .5); }
.pill.closed { color: var(--muted); }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.phone { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* ---------- clients ---------- */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.folder { display: grid; gap: 8px; text-decoration: none; color: inherit; padding-top: 30px; transition: transform .25s var(--ease), box-shadow .25s; }
.folder::before { content: ""; position: absolute; top: -1px; inset-inline-start: 22px; width: 90px; height: 16px; border-radius: 10px 10px 0 0; background: linear-gradient(180deg, rgba(168, 77, 255, .6), rgba(111, 30, 232, .35)); }
.folder:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px rgba(236, 170, 255, .6), 0 0 30px rgba(140, 40, 255, .4); }
.folder .name { font: 900 30px/1 var(--f-cap); color: #fff; }
.search { max-width: 320px; }

/* ---------- client page ---------- */
.client-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .client-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.input.sm { padding: 10px 12px; font-size: 15px; border-radius: 12px; }
.saved { font-size: 13px; color: var(--muted); transition: opacity .3s; }

/* videos */
.drop { display: grid; place-items: center; gap: 8px; text-align: center; padding: 26px 16px; border-radius: 20px; border: 2px dashed rgba(170, 70, 255, .55); background: rgba(8, 0, 20, .35); cursor: pointer; transition: background .2s, border-color .2s; }
.drop:hover, .drop.over { background: rgba(170, 70, 255, .12); border-color: var(--lilac); }
.drop b { font: 900 26px/1 var(--f-cap); color: #fff; }
.uploads { display: grid; gap: 8px; margin-top: 12px; }
.up { display: grid; gap: 6px; font-size: 14px; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--lilac)); box-shadow: 0 0 10px var(--rim); transition: width .2s; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 42%), 1fr)); gap: 14px; margin-top: 16px; }
.vid { position: relative; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #12052a; box-shadow: inset 0 0 0 1.5px rgba(170, 70, 255, .55), 0 0 20px rgba(130, 20, 230, .3); cursor: pointer; border: 0; padding: 0; display: block; width: 100%; }
.vid img, .vid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid .play { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent 55%, rgba(8, 0, 20, .85)); }
.vid .play span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(170, 70, 255, .5); box-shadow: 0 0 24px rgba(170, 70, 255, .8); backdrop-filter: blur(6px); }
.vid .play svg { width: 22px; height: 22px; fill: #fff; margin-inline-start: 3px; }
.vid .vname { position: absolute; inset: auto 10px 10px; font-size: 13px; font-weight: 600; text-align: start; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vid .del { position: absolute; top: 8px; inset-inline-end: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(8, 0, 20, .7); color: #ffc2d6; cursor: pointer; opacity: 0; transition: opacity .2s; }
.vid:hover .del, .vid:focus-within .del { opacity: 1; }
@media (hover: none) { .vid .del { opacity: 1; } }

/* tasks */
.tasks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.task { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; background: rgba(8, 0, 20, .4); }
.task input[type="checkbox"] { appearance: none; width: 22px; height: 22px; border-radius: 7px; flex: none; margin: 0; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--rim); background: rgba(8, 0, 20, .6); display: grid; place-items: center; }
.task input[type="checkbox"]:checked { background: linear-gradient(180deg, #a84dff, #6f1ee8); box-shadow: 0 0 12px rgba(170, 70, 255, .6); }
.task input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.task span { flex: 1; overflow-wrap: anywhere; }
.task.done span { color: var(--muted); text-decoration: line-through; }
.task .due { font-size: 12px; color: var(--lilac); white-space: nowrap; }
.task .due.late { color: #ff8db4; }
.task .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; }
.task .x:hover { color: #ff8db4; }
.add-task { display: flex; gap: 8px; margin-top: 12px; }
.add-task .input { flex: 1; }
.add-task input[type="date"] { flex: 0 0 150px; }
textarea.notes { min-height: 180px; resize: vertical; line-height: 1.6; }

/* chat */
.chat { display: flex; flex-direction: column; height: min(70svh, 640px); min-height: 380px; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.bubble { max-width: 82%; padding: 9px 13px 7px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.bubble time { display: flex; gap: 6px; align-items: center; justify-content: flex-end; font-size: 11px; opacity: .7; margin-top: 3px; }
.bubble.in { align-self: flex-start; background: linear-gradient(180deg, #ffffff, #efe2ff); color: #241040; border-start-start-radius: 6px; }
.bubble.out { align-self: flex-end; background: linear-gradient(180deg, #a84dff, #6f1ee8); color: #fff; border-start-end-radius: 6px; box-shadow: 0 6px 20px rgba(120, 30, 230, .35); }
.bubble.out.failed { background: rgba(255, 46, 126, .2); box-shadow: inset 0 0 0 1px rgba(255, 46, 126, .6); }
.bubble.sys { align-self: center; max-width: 90%; background: rgba(8, 0, 20, .55); color: var(--muted); font-size: 13px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.bubble .tag { font-size: 11px; font-weight: 700; color: var(--lilac); display: block; margin-bottom: 2px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: end; }
.chat-form textarea { flex: 1; min-height: 46px; max-height: 160px; resize: none; padding: 11px 14px; border-radius: 16px; }
.chat-form .btn { padding: 12px 18px; }
.wa-off { margin: 0; padding: 8px 14px; font-size: 13px; color: #ffe3a3; background: rgba(255, 200, 80, .08); border-bottom: 1px solid rgba(255, 200, 80, .25); }

/* ---------- popup for a new lead (the landing page's notification card) ---------- */
.toasts { position: fixed; top: 18px; left: 18px; z-index: 80; display: grid; gap: 12px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 16px; border-radius: 22px; background: linear-gradient(180deg, #ffffff, #efe2ff); color: #241040; box-shadow: 0 24px 60px rgba(120, 30, 230, .55), 0 0 0 1px rgba(255, 255, 255, .4); animation: pop .55s var(--ease) both; }
.toast .notif-top { margin-bottom: 10px; }
.toast h4 { margin: 0; font: 900 30px/1 var(--f-cap); color: #241040; }
.toast p { margin: 6px 0 0; font-size: 14px; color: #4d3577; }
.toast .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.toast .btn-ghost { color: #4b1fa0; box-shadow: inset 0 0 0 1.5px rgba(120, 50, 230, .4); }
.toast.mini { padding: 12px 14px; }
.toast.mini h4 { font-size: 22px; }

/* ---------- dialogs ---------- */
dialog.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 0; border: 0; border-radius: 28px; background: #150530; color: var(--ink); box-shadow: 0 0 0 2px rgba(170, 70, 255, .8), 0 0 40px rgba(130, 20, 230, .6); overflow: auto; }
dialog.modal::backdrop { background: rgba(5, 0, 14, .7); backdrop-filter: blur(6px); }
.modal-body { padding: 26px; display: grid; gap: 16px; }
.modal-body h2 { font: 900 40px/1 var(--f-cap); color: #fff; }
dialog.player { width: min(440px, calc(100vw - 24px)); background: #000; }
dialog.player video { display: block; width: 100%; max-height: calc(100svh - 120px); background: #000; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: #150530; }
.player-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- settings ---------- */
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.status-dot.ok { background: #2be37b; box-shadow: 0 0 12px #2be37b; }
.status-dot.warn { background: #ffc850; box-shadow: 0 0 12px #ffc850; }
.status-dot.bad { background: var(--pink); box-shadow: 0 0 12px var(--pink); }
.qr { width: 264px; max-width: 100%; aspect-ratio: 1; padding: 12px; border-radius: 18px; background: #fff; display: grid; place-items: center; box-shadow: 0 0 30px rgba(170, 70, 255, .6); }
.qr img, .qr canvas, .qr svg { width: 100%; height: 100%; image-rendering: pixelated; }
.hint { font-size: 13px; color: var(--muted); }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: rgba(8, 0, 20, .6); padding: 2px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }

/* ---------- sign-in screens (admin login + client code) ---------- */
.gate { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(440px, 100%); text-align: center; display: grid; gap: 18px; justify-items: center; padding: 34px 26px; }
.gate-logo { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 0 40px rgba(150, 60, 255, .7)); animation: bob 5s ease-in-out infinite; }
.gate h1 { font-size: clamp(44px, 9vw, 64px); line-height: .95; display: grid; gap: 4px; }
.gate .btn { width: 100%; padding-block: 16px; }
.g-btn { background: #fff; color: #241040; box-shadow: 0 10px 34px rgba(140, 40, 255, .5); }
.g-btn:hover { transform: translateY(-2px); }
.code-input { font: 800 34px/1 var(--f-lat); letter-spacing: .45em; text-align: center; direction: ltr; padding: 16px 10px 16px calc(10px + .45em); }
.err-box { color: #ff8db4; font-size: 14px; min-height: 1.2em; margin: 0; }
.err-box:empty { display: none; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(236, 170, 255, .25); border-top-color: var(--lilac); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px; }

@media (prefers-reduced-motion: reduce) {
  .gate-logo, .toast { animation: none; }
  .folder, .btn { transition: none; }
}

/* upload dialog and push row */
.up-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.up-files li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(140, 40, 255, .1); font-size: 14px; }
.up-files li span:first-child { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.push-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.push-row > div:first-child { flex: 1 1 260px; }
.push-row .err-box:empty { display: none; }

/* ---------- mobile nav: seven pages fit by scrolling sideways ---------- */
@media (max-width: 860px) {
  .side { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .nav-link { flex: 1 0 64px; padding: 7px 6px; }
}

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 14px; }
.stat { display: grid; gap: 4px; padding: 16px 18px; text-decoration: none; color: inherit; }
.stat b { font: 900 34px/1.05 var(--f-lat); color: #fff; font-variant-numeric: tabular-nums; }
a.stat:hover { box-shadow: inset 0 0 0 1.5px rgba(236, 170, 255, .5), 0 0 24px rgba(140, 40, 255, .3); }
.late, h3.late { color: #ff8db4; }
.bars { display: flex; align-items: stretch; gap: 8px; height: 170px; }
.bar-col { flex: 1; display: grid; grid-template-rows: 1fr auto; gap: 6px; min-width: 0; }
.bar-col > span { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }
.bar-stack { display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid rgba(170, 70, 255, .25); }
.bar-stack i { flex: 0 1 18px; min-height: 2px; border-radius: 4px 4px 0 0; cursor: default; }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.bar-tip { position: absolute; z-index: 90; pointer-events: none; padding: 6px 10px; border-radius: 10px; background: #fff; color: #241040; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); white-space: nowrap; }
.task-link { flex: 1; display: grid; gap: 1px; text-decoration: none; color: inherit; min-width: 0; text-align: start; }
.task-link span { overflow-wrap: anywhere; }
.link-plain { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

/* ---------- money ---------- */
.pays { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.pay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 14px; background: rgba(8, 0, 20, .4); }
.pay.late { box-shadow: inset 0 0 0 1px rgba(255, 46, 126, .5); }
.pay .amt { font: 800 20px/1 var(--f-lat); color: #fff; min-width: 72px; font-variant-numeric: tabular-nums; }
.pay-main { flex: 1 1 150px; display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.pay-main a { color: var(--lilac); }
.pay .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; }
.pay .x:hover { color: #ff8db4; }
.add-pay { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.add-pay .input { flex: 1 1 130px; width: auto; }
.month-nav { align-items: center; }
.month-nav b { min-width: 120px; text-align: center; }

/* ---------- chat: AI and saved answers ---------- */
.ai-bar { margin: 0; padding: 8px 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--lilac); background: rgba(170, 70, 255, .1); border-bottom: 1px solid var(--line); }
.ai-bar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ai-bar span { flex: 1; color: var(--ink); }
.chat { position: relative; }
.chat-tools { display: flex; flex-direction: column; gap: 4px; }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; border: 0; display: grid; place-items: center; cursor: pointer; color: var(--lilac); background: rgba(170, 70, 255, .14); }
.icon-btn:hover { background: rgba(170, 70, 255, .3); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.icon-btn.busy svg { animation: spin 1.2s linear infinite; }
.qr-pop { position: absolute; inset-inline: 12px; bottom: 104px; z-index: 5; max-height: 260px; overflow: auto; display: grid; gap: 4px; padding: 6px; border-radius: 16px; background: #1d0a3d; box-shadow: 0 0 0 1px var(--rim), 0 18px 40px rgba(0, 0, 0, .5); }
.qr-pop button { display: grid; gap: 2px; text-align: start; padding: 9px 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.qr-pop button:hover { background: rgba(170, 70, 255, .2); }
.qr-pop button span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble.draft { background: rgba(170, 70, 255, .12); color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(236, 170, 255, .6); border-style: dashed; }
.draft-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; white-space: nowrap; }
.draft-text { display: block; }
.draft-acts .btn { background: linear-gradient(180deg, #a84dff, #6f1ee8); color: #fff; }

/* ---------- AI page and settings ---------- */
.choice { display: flex; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.choice:hover { background: rgba(170, 70, 255, .08); }
.choice input { margin-top: 5px; accent-color: #a84dff; }
.choice > span { display: grid; gap: 2px; }
.days { display: flex; gap: 6px; margin-top: 8px; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 14px; background: rgba(8, 0, 20, .5); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.days input:checked + span { background: linear-gradient(180deg, #a84dff, #6f1ee8); color: #fff; }
.days input:focus-visible + span { outline: 2px solid var(--lilac); }
.warn-box { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 13px; color: #ffe3a3; background: rgba(255, 200, 80, .08); box-shadow: inset 0 0 0 1px rgba(255, 200, 80, .3); }
.devices { flex-basis: 100%; display: grid; gap: 6px; }
.device { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(8, 0, 20, .4); font-size: 14px; }
.device > span { display: grid; gap: 2px; }

/* ---------- images in chat and briefs ---------- */
.msg-img { display: block; margin: 2px 0 6px; }
.msg-img img { display: block; max-width: 220px; max-height: 260px; border-radius: 12px; object-fit: cover; }
.brief-media { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.brief-media img { width: 96px; height: 96px; object-fit: contain; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
