/* Grono admin — tokens and components from docs/grono-store-mockup.html */
:root {
  --bg: #f6f4ef; --surface: #ffffff; --ink: #1d211c; --muted: #6b7068; --line: #e6e2d8;
  --green: #3f7d3b; --green-2: #e7f0e3; --amber: #b7791f; --red: #b42318; --red-2: #fdecea;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
}
* { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, sans-serif }
h1, h2, h3 { font-family: Newsreader, Georgia, serif; font-weight: 600; margin: 0 }
a { color: var(--green) }
button { font: inherit; cursor: pointer }
code { font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted) }

.grid { display: grid; gap: 16px }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.muted { color: var(--muted) }
.small { font-size: 12px }
.num { font-variant-numeric: tabular-nums; white-space: nowrap }
.hide { display: none !important }
.right { text-align: right }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow) }
.card h3 { font-size: 20px; margin-bottom: 12px }
.subhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px }
.page-head h1 { font-size: 30px }

.btn { display: inline-block; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; color: var(--ink); text-decoration: none; white-space: nowrap; font: inherit; cursor: pointer }
.btn:hover { border-color: var(--ink) }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff }
.btn.danger { color: var(--red) }
.btn.wide { width: 100%; padding: 12px }
.btn-ghost { background: transparent; color: inherit; border-color: #3a4038; padding: 6px 12px }
.btn-ghost:hover { border-color: #cfd3cb }
form.button_to { display: inline }

.pill { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap }
.pill.ok { background: var(--green-2); border-color: #cfe2c8; color: #2c5f29 }
.pill.warn { background: #fff4e0; border-color: #f4dcae; color: #8a5a12 }
.pill.bad { background: var(--red-2); border-color: #f5c6c2; color: var(--red) }

table { width: 100%; border-collapse: collapse }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top }
th { font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em }
tr.hl { background: #f3f8f1 }
.table-wrap { overflow-x: auto }

.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px }
.flash.ok { background: var(--green-2); color: #2c5f29; border: 1px solid #cfe2c8 }
.flash.bad { background: var(--red-2); color: var(--red); border: 1px solid #f5c6c2 }

/* forms */
.fld { display: grid; gap: 4px; font-size: 13px }
.fld > span { color: var(--muted) }
.fld input, .fld select, .fld textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; background: #fff; width: 100% }
.fld.bad input { border-color: var(--red); background: #fffafa }
.fld em, .err { color: var(--red); font-style: normal; font-size: 12px }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 8px 0 }
.chk input { margin-top: 3px }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; min-height: 60px }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
@media (max-width: 600px) { .f2 { grid-template-columns: 1fr } }

/* layout */
.admin { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh }
.side { background: #171a16; color: #cfd3cb; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px }
.side-brand { font-family: Newsreader, serif; color: #fff; font-size: 20px; padding: 4px 12px 14px; text-decoration: none }
.side a, .side .disabled { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px }
.side a.on, .side a:hover { background: #2a2f28; color: #fff }
.side .disabled { opacity: .45; cursor: default }
.side .badge { background: var(--amber); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px }
.side-foot { margin-top: auto; padding: 14px 12px 0; display: grid; gap: 8px }
.side-foot .muted { color: #8d938a; overflow-wrap: anywhere }
.main { padding: 24px; min-width: 0 }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr }
  .side { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 8px; align-items: center }
  .side-brand { padding: 4px 10px; font-size: 17px; white-space: nowrap }
  .side a, .side .disabled { white-space: nowrap }
  .side-foot { margin: 0 0 0 auto; padding: 0; display: flex; align-items: center }
  .side-foot .muted { display: none }
  .main { padding: 16px }
}

/* dashboard */
.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) }
.kpi .v { font-family: Newsreader, serif; font-size: 30px }
.kpi .d { font-size: 12px }
.two { grid-template-columns: 1.2fr 1fr }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr } }

/* auth */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px }
.auth-box { width: 100%; max-width: 400px }
.auth-box .brand { font-family: Newsreader, serif; font-size: 26px; font-weight: 600; color: var(--green); text-align: center; margin-bottom: 16px }
.qr-setup { display: grid; place-items: center; margin: 12px 0 }
.qr { width: 180px; height: 180px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px }

/* settings / feature flags */
.narrow { max-width: 820px }
.narrow + .narrow { margin-top: 16px }
.flag { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line) }
.flag:last-of-type { border-bottom: 0 }
.flag b { display: block; margin-bottom: 2px }
.flag .muted { font-size: 13px }
.flag .muted + .muted { margin-top: 4px }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; color: var(--muted) }
.seg button.on { background: var(--ink); color: #fff }
.sw { width: 46px; height: 26px; border-radius: 99px; background: #d6d3ca; border: 0; position: relative; padding: 0 }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2) }
.sw.on { background: var(--green) }
.sw.on::after { left: 23px }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
@media (max-width: 600px) { .flag { grid-template-columns: 1fr } }

/* lists, filters, details */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px }
.filters input[type=search], .filters select, .inline-form input, .inline-form select, td input[type=date], .row select {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; background: #fff }
.filters input[type=search] { flex: 1; min-width: 220px }
.inline-form { margin-top: 14px; align-items: flex-end }
.inline-form input[type=text], .inline-form input[type=url] { flex: 1; min-width: 180px }
.nowrap { flex-wrap: nowrap }
.page-head h1 .pill { vertical-align: middle; font-family: Inter, sans-serif; font-weight: 500 }
tr.total td { border-bottom: 0 }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 12px 0 0 }
.kv dt { color: var(--muted) }
.kv dd { margin: 0 }
.tl { list-style: none; padding: 0; margin: 0 }
.tl li { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px }
.tl time { color: var(--muted); font-size: 12px }
.crm-head { display: flex; gap: 14px; align-items: center }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--green-2); display: grid; place-items: center; font-weight: 600; color: var(--green); flex: none }
.stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) }
.tags .pill { margin: 0 4px 4px 0; text-decoration: none; color: inherit }
.notes { list-style: none; padding: 0; margin: 14px 0 0 }
.notes li { padding: 10px 0; border-top: 1px dashed var(--line) }
.notes li.pinned { background: #fffbf0; margin: 0 -10px; padding: 10px }
.notes li.pinned::before { content: '📌 '; }
button.link { border: 0; background: none; padding: 0; color: var(--green); font-size: 12px; text-decoration: underline }
button.link.danger { color: var(--red) }
nav.pagination { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap }
nav.pagination span a, nav.pagination span.current { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 13px }
nav.pagination span.current { background: var(--ink); color: #fff; border-color: var(--ink) }

/* blog editor */
.edgrid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start }
@media (max-width: 1000px) { .edgrid { grid-template-columns: 1fr } }
.edtitle { width: 100%; border: 0; font-family: Newsreader, serif; font-size: 30px; font-weight: 600; outline: none; padding: 4px 0; margin-bottom: 8px; background: transparent }
trix-toolbar .trix-button-group { border-color: var(--line); border-radius: 8px }
trix-toolbar .trix-button--text { font-weight: 600; font-size: 13px; width: auto; padding: 0 8px; text-indent: 0 }
trix-toolbar .trix-button--text::before { display: none }
trix-editor { min-height: 320px; border: 1px solid var(--line) !important; border-radius: 10px; padding: 14px 18px !important; background: #fff; line-height: 1.65 }
trix-editor.trix-content h2, .prose h2 { font-family: Newsreader, serif; font-size: 24px; margin: 18px 0 6px }
trix-editor.trix-content h3, .prose h3 { font-family: Newsreader, serif; font-size: 20px; margin: 14px 0 4px }
trix-editor.trix-content p, .prose p { margin: 0 0 10px }
trix-editor.trix-content blockquote, .prose blockquote { margin: 12px 0; padding: 2px 14px; border-left: 3px solid var(--green) }
.editor-stats { margin-top: 8px }
.fld em.cnt { color: var(--muted) }
.fld em.cnt.over { color: var(--red) }
.card .fld + .fld, .card .fld + .chk, .card .chk + .fld { margin-top: 10px }
.serp { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; font-family: Arial, sans-serif; margin-top: 6px }
.serp .u { font-size: 12px; color: #4d5156 }
.serp .t { font-size: 18px; color: #1a0dab; margin: 3px 0; line-height: 1.3 }
.serp .d { font-size: 13px; color: #4d5156; line-height: 1.45 }
.coverprev { height: 150px; border-radius: 12px; overflow: hidden; background: var(--bg) }
.coverprev img { width: 100%; height: 100%; object-fit: cover }
.cv { display: grid; place-items: center; font-family: Newsreader, serif; font-size: 28px; color: rgba(255,255,255,.92); background-size: cover; background-position: center; height: 150px }
.cv0 { background-image: linear-gradient(135deg, #e6e2d8, #cfcab9); color: #6b7068; font: 13px Inter, sans-serif; padding: 16px; text-align: center; height: 100% }
.cv1 { background-image: linear-gradient(135deg, #7aa86a, #3f7d3b) }
label.upload { margin-top: 10px; cursor: pointer }
.seg a { display: inline-block; padding: 6px 14px; border-radius: 999px; color: var(--muted); text-decoration: none }
.seg a.on { background: var(--ink); color: #fff }

/* preview (as on the site) */
.preview-body { padding: 24px 16px }
.banner { background: #fff4e0; border: 1px solid #f4dcae; color: #8a5a12; border-radius: 10px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; max-width: 760px; margin: 0 auto 16px }
.article { max-width: 760px; margin: 0 auto }
.article .cv { height: 280px; border-radius: 16px }
.article h1 { font-size: 40px; margin: 14px 0 8px; line-height: 1.15 }
.tags-row { margin-top: 16px; gap: 6px }
.prose { font-size: 17px; line-height: 1.7; margin-top: 18px }
.prose img { max-width: 100%; height: auto; border-radius: 12px; display: block }
.prose figure { margin: 18px 0 }
.prose figcaption { font-size: 13px; color: var(--muted); margin-top: 6px }
.prose blockquote { font-family: Newsreader, serif; font-size: 21px; color: #3a4038 }
.cta { margin-top: 32px }
