/* Admin — mobile first: bottom tab bar on phones, sidebar from 900px. */
:root { --bg: #f5f6f0; --ink: #17242b; --muted: #637177; --line: #e2dbd0; --sea: #56654b; --sea-2: #435039; --danger: #b3261e; --ok: #1f7a4a; --r: 12px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Inter, sans-serif; }
a { color: var(--sea); }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; }
.shell { min-height: 100vh; }
.main { padding: 16px 16px 110px; max-width: 1100px; }
.bar { margin: 4px 0 16px; }
.side { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.side a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--muted); text-decoration: none; padding: 4px 0; }
.side a svg { width: 22px; height: 22px; }
.side a[aria-current="page"] { color: var(--sea); font-weight: 600; }
.side .out, .side form { display: none; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 220px 1fr; }
  .side { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; border-top: 0; border-right: 1px solid var(--line); padding: 20px 12px; gap: 2px; }
  .side a { flex: none; flex-direction: row; gap: 12px; font-size: .95rem; padding: 10px 12px; border-radius: 10px; }
  .side a[aria-current="page"] { background: #eef4f5; }
  .side .out, .side form { display: block; margin-top: 8px; }
  .side form { margin-top: auto; }
  .side button.out { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 10px 12px; font: inherit; }
  .main { padding: 28px 32px 60px; }
}
.card { background: #fff; border-radius: var(--r); padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.err { color: var(--danger); }
.flash { background: #e7f4ec; color: var(--ok); padding: 10px 14px; border-radius: 10px; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(5, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-decoration: none; color: var(--ink); }
.stat b { display: block; font-size: 1.6rem; }
.stat span { font-size: .82rem; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--sea); background: var(--sea); color: #fff; font: 600 .95rem system-ui, sans-serif; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--sea-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--sea); }
.btn-ghost:hover { background: #eef4f5; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.link { border: 0; background: none; color: var(--sea); cursor: pointer; padding: 0; font: inherit; font-size: .8rem; }
.link.danger { color: var(--danger); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small, .row-side small { color: var(--muted); }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row-img { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: #ece5da; flex: 0 0 64px; }
.pill { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #ece5da; white-space: nowrap; }
.pill-new, .pill-review { background: #fdebd9; color: #9a4b12; }
.pill-contacted, .pill-visit, .pill-offer { background: #e3eef7; color: #1d4f7a; }
.pill-won, .pill-published { background: #e1f3e8; color: var(--ok); }
.pill-lost, .pill-sold { background: #eee; color: #555; }
.pill-reserved { background: #f3e6f7; color: #6a2c7e; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; }
.tabs a { white-space: nowrap; padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .88rem; }
.tabs a[aria-current="true"] { background: var(--ink); color: #fff; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }
.form label, .search input { display: grid; gap: 4px; font-weight: 500; font-size: .88rem; margin-bottom: 10px; }
.form input:not([type=checkbox]), .form select, .form textarea, .search input { width: 100%; font: 16px system-ui, sans-serif; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.form textarea { resize: vertical; line-height: 1.5; }
.check { display: flex !important; gap: 10px; align-items: center; font-weight: 400 !important; }
.check input { width: 20px; height: 20px; }
.grid2, .grid3 { display: grid; gap: 0 14px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.lang-panes { display: grid; gap: 12px; }
@media (min-width: 1200px) { .lang-panes { grid-template-columns: repeat(3, 1fr); } }
.lang-pane { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0; min-width: 0; }
.lang-pane legend { font-weight: 700; padding: 0 6px; }
.sticky-actions { position: sticky; bottom: 76px; background: rgba(244, 241, 236, .95); padding: 10px 0; z-index: 5; }
@media (min-width: 900px) { .sticky-actions { bottom: 0; } }
.ai-msg { font-weight: 500; color: var(--sea); min-height: 1.2em; }
.ai-msg.err { color: var(--danger); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.thumb { margin: 0; }
.thumb img { border-radius: 8px; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.thumb figcaption { display: flex; justify-content: space-between; gap: 6px; font-size: .8rem; padding-top: 4px; }
.cover-prev { max-height: 90px; border-radius: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.pre { white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 10px; }
.socials { display: grid; gap: 12px; }
@media (min-width: 900px) { .socials { grid-template-columns: repeat(3, 1fr); } }
.social { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.social.done { opacity: .6; }
.social header { font-size: .85rem; margin-bottom: 6px; }
.social textarea { width: 100%; font: 14px system-ui, sans-serif; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.social form { margin: 0; }
.convo { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 12px; margin: 0; white-space: pre-wrap; }
.msg small { display: block; font-size: .7rem; opacity: .6; margin-top: 4px; }
.msg.me { background: var(--sea); color: #fff; align-self: flex-end; }
.msg.bot { background: var(--bg); align-self: flex-start; }
.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-box { background: #fff; padding: 28px; border-radius: 16px; width: 100%; max-width: 380px; display: grid; gap: 12px; border: 1px solid var(--line); }
.login-box label { display: grid; gap: 4px; font-weight: 500; }
.login-box input { font: 16px system-ui; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }

.kit { line-height: 1.6; overflow-wrap: anywhere; }
.kit h1 { font-size: 1.3rem; margin-bottom: 8px; }
.kit h2 { font-size: 1.15rem; margin: 26px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.kit-sec { position: relative; background: var(--bg); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.kit-sec h3 { margin: 0 90px 8px 0; font-size: 1rem; }
.kit-copy { position: absolute; top: 10px; right: 10px; }
.kit blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid #c3925f; background: #fff; border-radius: 6px; }
.kit table { width: 100%; border-collapse: collapse; font-size: .88rem; display: block; overflow-x: auto; }
.kit th, .kit td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.kit code { background: #fff; padding: 1px 5px; border-radius: 4px; }
.kit code { white-space: pre-wrap; word-break: break-word; }
.kit pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; padding: 10px; border-radius: 8px; }
.main { min-width: 0; }
.assist-fab { position: fixed; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; border: 0; border-radius: 99px; background: #c3925f; color: #fff; font: 600 .9rem system-ui; padding: 12px 16px; box-shadow: 0 8px 22px rgba(0,0,0,.2); cursor: pointer; display: flex; gap: 6px; align-items: center; }
@media (min-width: 900px) { .assist-fab { bottom: 20px; right: 24px; } }
@media (max-width: 480px) { .assist-fab span { display: none; } }
.assist-panel { position: fixed; z-index: 40; inset: auto 0 0 0; height: min(82vh, 640px); background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.assist-panel[hidden] { display: none; }
@media (min-width: 900px) { .assist-panel { inset: auto 24px 20px auto; width: 420px; border-radius: 16px; } }
.assist-panel header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.assist-panel header button { border: 0; background: none; font-size: 1.6rem; width: 40px; height: 40px; cursor: pointer; }
.assist-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.assist-page .assist-log { max-height: 60vh; min-height: 120px; border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; }
.amsg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: .94rem; line-height: 1.5; }
.amsg p { margin: 0 0 .5em; } .amsg p:last-child { margin: 0; } .amsg ul, .amsg ol { margin: .3em 0; padding-left: 1.2em; }
.amsg.user { align-self: flex-end; background: var(--sea); color: #fff; white-space: pre-wrap; }
.amsg.assistant { align-self: flex-start; background: var(--bg); }
.amsg.typing { opacity: .6; }
.assist-f { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.assist-page .assist-f { border: 0; padding: 0; }
.assist-f textarea { flex: 1; font: 16px system-ui; padding: 10px; border: 1px solid var(--line); border-radius: 10px; resize: none; }
.sugg { margin-bottom: 6px; }

@media (max-width: 899px) { .side { justify-content: flex-start; overflow-x: auto; gap: 2px; scrollbar-width: none; } .side a { flex: 0 0 64px; } }
.task { gap: 10px; } .task.done strong { text-decoration: line-through; opacity: .6; }
.task form { margin: 0; } .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--sea); background: #fff; color: var(--sea); cursor: pointer; font-weight: 700; }
.task.done .tick { background: var(--sea); color: #fff; }
.wa-list .row.active { background: #eef4f5; border-radius: 8px; }
.wa-thread .convo { max-height: 60vh; overflow-y: auto; margin-bottom: 12px; }
.card code, .card li { overflow-wrap: anywhere; word-break: break-word; }
.assist-hint { color: var(--muted); font-size: .9rem; }
.assist-hint .quick { margin-top: 8px; }
.inline-del { display: inline; margin: 0 4px 0 0; } .inline-del .link { font-size: .8rem; }
