/* Vyonova admin */
:root {
  --ink: #0b1633;
  --ink-2: #1c2a4d;
  --muted: #5b6b8c;
  --line: #e2e8f2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --accent: #1e6fe8;
  --accent-2: #1558c0;
  --sky: #5ab8ff;
  --nav: #0a1330;
  --nav-2: #13224a;
  --ok: #10915a;
  --warn: #b7791f;
  --danger: #d23b3b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 22, 51, 0.06), 0 8px 24px -12px rgba(11, 22, 51, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 800; }
p { margin: 0 0 0.75rem; }
img { max-width: 100%; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 5px 0; }
.lead { color: var(--muted); max-width: 72ch; margin: 0; line-height: 1.55; }
.subhead { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; margin: 18px 0 10px; }
.req { color: var(--danger); }
.error { color: var(--danger); font-size: 12.5px; margin: 6px 0 0; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; background: linear-gradient(180deg, var(--nav), #070d22);
  color: #c9d6f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; color: #fff; text-decoration: none !important; }
.brand strong { display: block; letter-spacing: 0.18em; font-size: 15px; }
.brand small { display: block; color: var(--sky); font-size: 11px; letter-spacing: 0.08em; font-weight: 700; }
.sidebar nav { padding: 6px 12px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: #6d7fa8; padding: 16px 10px 6px; font-weight: 800; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #c9d6f2; font-weight: 600;
  text-decoration: none !important; transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(30, 111, 232, 0.35), rgba(30, 111, 232, 0.12)); color: #fff; box-shadow: inset 2px 0 0 var(--sky); }
.nav-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; opacity: 0.9; }
.badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 8px; font-weight: 800; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); display: grid; gap: 10px; }
.sidebar-foot .linkish { color: #8fa3cc; font-size: 12.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 22px 32px 6px; }
.topbar h1 { font-size: 1.55rem; font-weight: 800; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.menu-btn { display: none; border: 0; background: var(--card); border-radius: 8px; width: 38px; height: 38px; font-size: 18px; box-shadow: var(--shadow); cursor: pointer; }
.content { padding: 16px 32px 60px; display: grid; gap: 18px; align-content: start; }
.flashes { padding: 0 32px; display: grid; gap: 8px; margin-top: 10px; }

/* ---------- cards & layout ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row-inline { display: flex; align-items: center; gap: 8px; }
.row-inline.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 8px; }
.stack-sm { display: grid; gap: 8px; margin-top: 12px; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(135deg, #eef5ff, #fff); border-color: #cfe0fa; }
.callout h2 { margin-bottom: 6px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-color: #f4d4d4; }
.empty { text-align: center; padding: 30px 10px; }
.empty h2 { margin-bottom: 8px; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; transition: transform 0.15s, border-color 0.15s; }
.stat:hover { transform: translateY(-2px); border-color: #bcd3f7; }
.stat strong { display: block; font-size: 1.7rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat:first-child { background: linear-gradient(135deg, var(--accent), #0d3a8c); color: #fff; border: 0; }
.stat:first-child span { color: rgba(255, 255, 255, 0.8); }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-link { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink); text-decoration: none !important; transition: border-color 0.15s, background 0.15s; }
.quick-link:hover { border-color: var(--accent); background: #f6f9ff; }
.quick-link strong { display: block; margin-bottom: 2px; }
.quick-link span { color: var(--muted); font-size: 12.5px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 800; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f7faff; }
.row-link.is-new td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; text-transform: capitalize; background: #eef2f8; color: var(--muted); }
.pill-new, .pill-published { background: #e6f0ff; color: var(--accent-2); }
.pill-contacted { background: #fff4e0; color: var(--warn); }
.pill-closed { background: #e7f6ee; color: var(--ok); }
.pill-draft { background: #fff1e6; color: #b45309; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 14px; }

.tabs { display: flex; gap: 4px; background: #e9eef7; padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.tab { padding: 7px 12px; border-radius: 7px; color: var(--muted); font-weight: 700; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 700; text-decoration: none !important; }
.tab span { opacity: 0.7; font-size: 12px; margin-left: 3px; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* ---------- section / item lists ---------- */
.section-list { display: grid; gap: 8px; }
.section-card {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--ink); text-decoration: none !important; transition: border-color 0.15s, box-shadow 0.15s;
}
a.section-card:hover, .section-card:hover { border-color: #b7cff5; box-shadow: 0 4px 14px -8px rgba(30, 111, 232, 0.4); }
.section-card .grow { display: grid; gap: 2px; color: inherit; text-decoration: none !important; }
.section-card .num { width: 34px; height: 34px; border-radius: 9px; background: #eef4ff; color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.chev-right { font-size: 22px; color: #a9b7d3; }
.drag { cursor: grab; color: #a9b7d3; letter-spacing: -3px; user-select: none; padding: 0 4px; font-size: 14px; }
.list-thumb { width: 52px; height: 40px; border-radius: 7px; overflow: hidden; background: #eef2f8; flex-shrink: 0; display: grid; place-items: center; }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-thumb.is-icon { background: #f3f6fc; }
.list-thumb.is-icon img { width: 30px; height: 30px; object-fit: contain; }

.block-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.block-type { border: 1.5px dashed #c5d4ee; background: #f8fbff; border-radius: 10px; padding: 14px; cursor: pointer; font: inherit; color: var(--accent-2); transition: all 0.15s; }
.block-type:hover { border-color: var(--accent); background: #eef5ff; }

/* ---------- forms ---------- */
.label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.help { color: var(--muted); font-size: 12px; margin: 4px 0 6px; line-height: 1.45; }
.input {
  width: 100%; border: 1px solid #d3dcec; border-radius: 9px; padding: 9px 11px; font: inherit; color: var(--ink); background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30, 111, 232, 0.15); }
textarea.input { resize: vertical; line-height: 1.5; }
.input-sm { padding: 6px 10px; font-size: 13px; }
select.input { cursor: pointer; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 700; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { background: #eef2f8; border: 1px solid #d3dcec; border-right: 0; border-radius: 9px 0 0 9px; padding: 9px 10px; color: var(--muted); font-size: 12.5px; white-space: nowrap; display: flex; align-items: center; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.prefix-input .input { border-radius: 0 9px 9px 0; }
.swatch { width: 42px; height: 38px; border: 1px solid #d3dcec; border-radius: 8px; padding: 2px; background: #fff; }
.search .input { min-width: 240px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d3dcec; background: #fff; color: var(--ink);
  border-radius: 9px; padding: 9px 15px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important; transition: all 0.15s; white-space: nowrap;
}
.btn:hover { border-color: #aac0e6; background: #f7faff; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(30, 111, 232, 0.8); }
.btn-primary:hover { background: linear-gradient(135deg, #2a7bf0, #1a61cc); color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: #f0c6c6; }
.btn-danger:hover { background: #fdf2f2; border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f8; border-color: transparent; color: var(--ink); }
.btn-ghost-light { background: rgba(255, 255, 255, 0.06); color: #dbe6ff; border-color: rgba(255, 255, 255, 0.12); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.danger-text { color: var(--danger); }
.icon-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; display: inline-grid; place-items: center; }
.icon-btn:hover:not(:disabled) { background: #eef2f8; color: var(--ink); }
.icon-btn.danger:hover { background: #fdecec; color: var(--danger); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.upload-btn { cursor: pointer; }

/* ---------- editor ---------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.editor-side { display: grid; gap: 14px; }
.sticky { position: sticky; top: 18px; }
.unsaved { color: var(--warn); font-weight: 700; margin-top: 10px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { min-width: 0; }
.field-wide, .fields > .subhead { grid-column: 1 / -1; }
.list-item .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.list { display: grid; gap: 8px; }
.list-items { display: grid; gap: 8px; }
.list-item { border: 1px solid #dbe3f1; border-radius: 10px; background: #fbfcff; }
.list-item .list-item { background: #fff; }
.item-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid #e6ecf6; }
.item-toggle { flex: 1; text-align: left; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; padding: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { display: inline-block; transition: transform 0.15s; color: var(--muted); }
.item-tools { display: flex; gap: 2px; }
.item-body { padding: 14px; }
.list-item.collapsed .item-body { display: none; }
.list-item.collapsed .item-head { border-bottom: 0; }
.list-item.collapsed .chev { transform: rotate(-90deg); }
.btn-add { justify-self: start; border-style: dashed; color: var(--accent-2); }
.sortable-ghost { opacity: 0.4; }

.picker { display: flex; gap: 12px; align-items: flex-start; }
.picker-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.picker-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.thumb { width: 96px; height: 72px; border-radius: 9px; border: 1px solid var(--line); background: repeating-conic-gradient(#f0f3f9 0% 25%, #fff 0% 50%) 50% / 14px 14px; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb span { font-size: 11px; color: var(--muted); }
.thumb-icon { width: 56px; height: 56px; background: #f3f6fc; }
.thumb-icon img { width: 40px; height: 40px; object-fit: contain; }
.thumb-line img { width: 26px; height: 26px; }

.rte { border: 1px solid #d3dcec; border-radius: 9px; overflow: hidden; background: #fff; }
.rte .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid #e3e9f4; background: #f8faff; }
.rte .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 14.5px; }
.rte .ql-editor { min-height: 140px; max-height: 520px; overflow-y: auto; line-height: 1.6; }

.revisions li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #eef2f8; }
.details { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; margin: 0 0 8px; }
.details dt { color: var(--muted); font-weight: 700; }
.details dd { margin: 0; }
.message { background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 16px; line-height: 1.65; white-space: normal; margin-bottom: 12px; }

/* ---------- flash ---------- */
.flash { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; font-weight: 600; border: 1px solid; transition: opacity 0.6s; }
.flash button { border: 0; background: none; font-size: 18px; cursor: pointer; color: inherit; opacity: 0.6; }
.flash-success { background: #eaf8f0; border-color: #bfe8d0; color: #0c6b43; }
.flash-error { background: #fdeeee; border-color: #f3c7c7; color: #a42727; }
.flash-warning { background: #fff6e5; border-color: #f5dcaa; color: #8a5a0b; }
.flash.fade { opacity: 0.55; }

/* ---------- media ---------- */
.dropzone { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 2px dashed #c5d4ee; background: #f8fbff; flex-wrap: wrap; }
.dropzone.over { border-color: var(--accent); background: #eef5ff; }
.dropzone .input { max-width: 380px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.media-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.media-img { display: block; aspect-ratio: 4 / 3; background: repeating-conic-gradient(#f0f3f9 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.media-img img { width: 100%; height: 100%; object-fit: cover; }
.media-meta { padding: 12px; display: grid; gap: 6px; }
.copy-row { display: flex; gap: 6px; }

/* ---------- picker modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(7, 13, 34, 0.55); display: grid; place-items: center; z-index: 50; padding: 20px; backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; width: min(920px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head .input { max-width: 260px; margin-left: auto; }
.modal-tabs { display: flex; gap: 4px; padding: 10px 18px 0; }
.modal-body { padding: 14px 18px; overflow-y: auto; flex: 1; min-height: 240px; }
.modal-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pick-grid.icons { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pick { border: 1.5px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; cursor: pointer; display: grid; gap: 6px; font: inherit; text-align: center; transition: border-color 0.15s, transform 0.15s; }
.pick:hover { border-color: var(--accent); transform: translateY(-1px); }
.pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #f3f6fc; }
.pick-grid.icons .pick img { aspect-ratio: 1; object-fit: contain; padding: 10px; }
.pick span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #1b3b8f 0%, transparent 45%), radial-gradient(circle at 90% 90%, #1e6fe8 0%, transparent 40%), var(--nav); }
.login-card { background: #fff; border-radius: 18px; padding: 34px; width: min(420px, 100%); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.6); }
.login-card h1 { font-size: 1.5rem; margin: 22px 0 6px; }
.login-card form { margin-top: 18px; }
.login-card .btn-block { margin-top: 12px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong { display: block; letter-spacing: 0.18em; }
.login-brand small { color: var(--accent); font-weight: 700; font-size: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-grid { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, 0.4); }
  .menu-btn { display: block; }
  .topbar, .content, .flashes { padding-left: 16px; padding-right: 16px; }
  .grid-2, .quick { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields, .list-item .fields { grid-template-columns: 1fr; }
  .table th:nth-child(n+4), .table td:nth-child(n+4) { display: none; }
  .search .input { min-width: 0; }
  .callout { flex-direction: column; align-items: flex-start; }
}
