/* Geely CMS — minimal, in-house design that echoes the public site
   without depending on it. Uses the same brand colors (deep blue +
   sea-blue accent) and a clean editorial typography stack. */

:root {
  --gee-blue: #0E1A38;
  --gee-seagull: #2D8DC2;
  --paper: #FFFFFF;
  --paper-2: #F4F6FA;
  --paper-3: #E7ECF3;
  --ink: #0F172A;
  --mute: #64748B;
  --line-soft: #E5E9F0;
  --line-softer: #EFF2F7;
  --accent: #2D8DC2;
  --error: #DC2626;
  --ok: #16A34A;
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--mute); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  padding: 10px 18px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  font-family: inherit;
}
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary {
  background: var(--gee-blue);
  color: #fff;
}
.btn-primary:hover { background: #1A2B5F; }
.btn-primary:disabled { background: #5B6478; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-soft);
}
.btn-ghost:hover { background: var(--paper-3); }

/* ---------- Forms ---------- */
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 16px;
  margin-bottom: 6px;
}
.field {
  display: block;
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,141,194,.18); }

.form-error {
  margin-top: 14px;
  font-size: 13px;
  color: var(--error);
}

/* ---------- Login page ---------- */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  background: #fff;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 32px rgba(15,23,42,.08);
}
.brand-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.brand-mark {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--gee-blue);
}
.brand-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.login-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.login-sub {
  margin: 0 0 20px;
  color: var(--mute);
  font-size: 14px;
}
#login-form .btn {
  width: 100%;
  margin-top: 24px;
  padding: 13px 18px;
  font-size: 15px;
}
.legal {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line-softer);
  font-size: 12px;
  color: var(--mute);
  text-align: center;
}

/* ---------- App shell ---------- */
.app-page { display: flex; flex-direction: column; min-height: 100vh; }
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}
.app-header-right { display: flex; gap: 12px; align-items: center; }
.user-label { font-size: 13px; color: var(--mute); }

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side { display: none; }
}

.app-side {
  background: #fff;
  border-right: 1px solid var(--line-soft);
  padding: 16px 12px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}
.side-link:hover { background: var(--paper-3); text-decoration: none; }
.side-link.is-active { background: var(--gee-blue); color: #fff; }

.app-main { padding: 32px; }

/* CMS 3.0 — full-screen page builder. Hide sidebar + remove main padding so
   the preview iframe takes the entire viewport (Tilda-style). */
body.is-c3-active .app-side { display: none; }
body.is-c3-active .app-shell { grid-template-columns: 1fr; }
body.is-c3-active .app-main { padding: 0; }
body.is-c3-active .app-header { border-bottom: 1px solid var(--line-soft); }
.tab-section.content3-tab {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100vh - 60px);
}
.tab-section.content3-tab .content2-toolbar {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
/* Stage 5 — Tilda-style top-bar */
.c3-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
  font: 13px/1 ui-sans-serif, system-ui, -apple-system, Segoe UI, Inter, sans-serif;
  color: var(--ink);
  min-height: 48px;
}
.c3t-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px; border-radius: 6px;
  font: 600 13px/1 inherit; color: var(--ink);
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-soft); background: #fff;
  margin-right: 6px;
}
.c3t-back:hover { background: var(--paper-2); text-decoration: none; }
.c3-topbar .c3t-crumb {
  display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
  color: var(--mute);
  font-weight: 500;
}
.c3-topbar .c3t-crumb-sep { opacity: .4; }
.c3-topbar .c3t-page-pick {
  background: transparent; border: 0; padding: 4px 8px; border-radius: 6px;
  font: 600 14px/1 inherit; color: var(--ink);
  cursor: pointer; max-width: 320px;
  appearance: none; -webkit-appearance: none;
  /* Custom arrow via CSS */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 16px 16px;
  padding-right: 28px;
}
.c3-topbar .c3t-page-pick:hover { background-color: var(--paper-2); }
.c3-topbar .c3t-center { display: flex; align-items: center; gap: 4px; }
.c3-topbar .c3t-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.c3t-status { font-size: 12px; color: var(--mute); }
.c3t-status.is-ok { color: #1a7f3c; }
.c3t-status.is-err { color: #9a1d1d; }
.c3t-iconbtn {
  background: transparent; border: 1px solid var(--line-soft); border-radius: 6px;
  width: 32px; height: 32px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 16px;
}
.c3t-iconbtn:hover { background: var(--paper-2); }
.c3t-iconbtn.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.c3t-publish {
  background: var(--gee-blue); color: #fff; border: 0;
  padding: 8px 18px; border-radius: 6px;
  font: 600 13px/1 inherit; cursor: pointer;
}
.c3t-publish:hover { background: #002F87; }
.c3t-ghost {
  background: transparent; border: 1px solid var(--line-soft); color: var(--ink);
  padding: 7px 14px; border-radius: 6px;
  font: 600 13px/1 inherit; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.c3t-ghost:hover { background: var(--paper-2); text-decoration: none; }
.c3t-menu-wrap { position: relative; }
.c3t-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--line-soft); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(10,16,36,.12);
  min-width: 220px; z-index: 200;
  padding: 6px;
  display: none;
}
.c3t-menu.is-open { display: block; }
.c3t-menu button, .c3t-menu a {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; padding: 8px 10px; border-radius: 6px;
  font: 13px/1.3 inherit; color: var(--ink); cursor: pointer;
  text-decoration: none;
}
.c3t-menu button:hover, .c3t-menu a:hover { background: var(--paper-2); text-decoration: none; }
.c3t-menu .c3t-menu-sep { height: 1px; background: var(--line-soft); margin: 4px 6px; }
.c3t-menu .c3t-menu-label { font-size: 11px; color: var(--mute); padding: 6px 10px 4px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.tab-section.content3-tab .content2-frame-wrap {
  flex: 1;
  border: 0;
  border-radius: 0;
  min-height: 0;
}
.tab-section.content3-tab .content2-frame-wrap iframe {
  min-height: 0;
}
/* Right-panel for stage 3: editing a section. */
.c3-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr 0;
  transition: grid-template-columns .18s ease;
  min-height: 0;
}
.c3-shell.is-panel-open { grid-template-columns: 240px 1fr 380px; }
.c3-shell.is-sidebar-collapsed { grid-template-columns: 0 1fr 0; }
.c3-shell.is-sidebar-collapsed.is-panel-open { grid-template-columns: 0 1fr 380px; }
.c3-frame-col { min-width: 0; min-height: 0; display: flex; }
.c3-left {
  background: #fff;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.c3-left header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
  font: 700 12px/1 ui-sans-serif, system-ui;
  letter-spacing: .08em; text-transform: uppercase; color: var(--mute);
}
.c3-left .c3l-add {
  background: var(--gee-blue); color: #fff; border: 0;
  width: 24px; height: 24px; border-radius: 999px;
  font: 700 16px/1 ui-sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.c3-left .c3l-add:hover { background: #002F87; }
.c3l-list { flex: 1; overflow: auto; padding: 6px; }
.c3l-group-label {
  font: 600 10px/1 ui-sans-serif; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute); padding: 10px 6px 6px;
}
.c3l-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 6px;
  cursor: pointer; user-select: none;
  font: 13px/1.3 ui-sans-serif;
  color: var(--ink);
  border: 1px solid transparent;
  margin-bottom: 2px;
}
.c3l-item:hover { background: var(--paper-2); }
.c3l-item.is-active { background: rgba(45,141,194,.10); border-color: rgba(45,141,194,.35); }
.c3l-item.is-hidden { opacity: .55; }
.c3l-item .c3l-icon { font-size: 18px; line-height: 1; width: 24px; text-align: center; }
.c3l-item .c3l-text { min-width: 0; }
.c3l-item .c3l-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c3l-item .c3l-id { font: 11px ui-monospace, SF Mono, Menlo, monospace; color: var(--mute); }
.c3l-item .c3l-flag { font-size: 12px; opacity: .6; }
.c3l-item.is-drop-target { border-color: var(--gee-blue); background: rgba(45,141,194,.18); }
.c3l-item.is-dragging { opacity: .35; }
.c3-right {
  background: #fff;
  border-left: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.c3-right header.c3r-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
  gap: 8px;
}
.c3-right .c3r-title { font-weight: 700; font-size: 15px; }
.c3-right .c3r-id { font-family: ui-monospace, SF Mono, Menlo, monospace; font-size: 11px; color: var(--mute); margin-top: 2px; }
.c3-right .c3r-close {
  background: transparent; border: 0; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--mute); padding: 0 4px;
}
.c3r-tabs { display: flex; border-bottom: 1px solid var(--line-soft); }
.c3r-tab {
  flex: 1; padding: 10px 12px; background: transparent; border: 0; cursor: pointer;
  font: 600 13px/1 ui-sans-serif, system-ui; color: var(--mute);
  border-bottom: 2px solid transparent;
}
.c3r-tab.is-active { color: var(--ink); border-bottom-color: var(--gee-blue); }
.c3r-body {
  flex: 1; overflow: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 14px;
}
.c3r-field { display: flex; flex-direction: column; gap: 4px; }
.c3r-field label { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--mute); text-transform: uppercase; }
.c3r-field code { font-family: ui-monospace, SF Mono, Menlo, monospace; font-size: 11px; color: var(--mute); }
.c3r-field input, .c3r-field textarea, .c3r-field select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px;
  font: 14px/1.4 ui-sans-serif, system-ui; background: #fff; color: var(--ink);
}
.c3r-field textarea { resize: vertical; min-height: 60px; }
.c3r-image {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px; background: var(--paper-2);
}
.c3r-image img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; background: #fff; }
.c3r-image .meta { flex: 1; min-width: 0; font-size: 12px; color: var(--mute); overflow-wrap: anywhere; }
.c3r-image button { padding: 6px 12px; }
.c3r-image [data-c3-img-hint] { flex-basis: 100%; }
.c3r-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.c3r-foot { padding: 12px 14px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; background: var(--paper-2); }
.c3r-empty { padding: 32px 16px; text-align: center; color: var(--mute); font-size: 13px; }

.placeholder {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 720px;
}
.placeholder h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.placeholder p { margin: 8px 0; color: var(--ink); }
.placeholder.error { background: #FEF2F2; border-color: #FECACA; }
.placeholder.error h1 { color: var(--error); }

/* ---------- Sidebar states ---------- */
.side-link .tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--paper-3);
  color: var(--mute);
  border-radius: 999px;
  vertical-align: middle;
}
.side-link.is-active .tag { background: rgba(255,255,255,.2); color: rgba(255,255,255,.9); }
.side-link.is-disabled { opacity: 0.55; cursor: not-allowed; }
.side-link.is-disabled:hover { background: transparent; text-decoration: none; }
.is-hidden { display: none !important; }

.loading-pane {
  padding: 32px;
  color: var(--mute);
  font-size: 14px;
}

/* ---------- Tab generic ---------- */
.tab-section { max-width: 980px; }
.tab-head h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.tab-head p { margin: 0 0 24px; color: var(--mute); max-width: 640px; }

.card-form {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.form-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-softer);
}
.save-status { font-size: 13px; }

/* ---------- Provider cards (analytics) ---------- */
.provider-list {
  display: grid;
  gap: 14px;
}
.provider-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--paper-2);
  transition: border-color .12s ease, background .12s ease;
}
.provider-card.is-on {
  background: #F0F7FB;
  border-color: rgba(45,141,194,.4);
}
.provider-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.provider-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.provider-body { display: flex; flex-direction: column; gap: 8px; }
.provider-hint { font-size: 12px; margin: 0; }

/* ---------- Switch (toggle) ---------- */
.switch {
  display: inline-flex;
  position: relative;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  display: inline-block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #C7CFDC;
  position: relative;
  transition: background .12s ease;
}
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .14s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(16px); }
.switch input:disabled + .switch-track { opacity: 0.55; cursor: not-allowed; }

/* ---------- Toast ---------- */
#toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--gee-blue);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(15,23,42,.18);
  max-width: 360px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .18s ease, transform .18s ease;
}
.toast-err  { background: var(--error); }
.toast-warn { background: #B45309; }
.toast.is-out { opacity: 0; transform: translateY(8px); }

/* ---------- Password dialog ---------- */
.dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: none;
  max-height: none;
}
.dialog::backdrop {
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
}
.dialog-card {
  background: #fff;
  width: min(420px, calc(100vw - 32px));
  padding: 28px 28px 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15,23,42,.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dialog-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.dialog-card .field-label { margin-top: 8px; }
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* TOTP setup */
.totp-qr {
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 4px;
}
.totp-secret {
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: var(--paper-3);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin: 4px 0 8px;
  word-break: break-all;
  user-select: all;
}

/* ---------- Generic field-group inside cards ---------- */
.card-form .field-group { margin-bottom: 14px; }
.card-form .field-group:last-child { margin-bottom: 0; }
.card-form h2.section-h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.field-sm { padding: 6px 10px; font-size: 13px; }

.small { font-size: 12px; }

/* ---------- Lang tabs (RU/UZ/EN) ---------- */
.lang-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 0;
  margin-bottom: 18px;
}
.lang-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--mute);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.lang-tab:hover { color: var(--ink); }
.lang-tab.is-active {
  color: var(--gee-blue);
  border-bottom-color: var(--gee-blue);
}

/* ---------- SEO tab ---------- */
.seo-toolbar { display: flex; flex-direction: column; gap: 6px; max-width: 540px; margin-bottom: 18px; }
.seo-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.seo-form { display: flex; flex-direction: column; gap: 14px; }
.seo-page-extra { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-softer); }
.seo-page-extra summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--mute); }
.seo-extra-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
@media (max-width: 760px) { .seo-extra-body { grid-template-columns: 1fr; } }

/* ---------- Content tab ---------- */
.tab-section.content-tab-split {
  max-width: none;
  width: 100%;
}
.content-split {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1.4fr);
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .content-split { grid-template-columns: 1fr; }
}
.content-pane { display: flex; flex-direction: column; min-width: 0; }
.content-pane-preview { min-height: 70vh; }

.content-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.toolbar-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar-row .field-label { margin: 0; flex: 0 0 auto; }
.toolbar-row .field { flex: 1; min-width: 220px; }
.toolbar-row .lang-tabs { margin-bottom: 0; flex: 0 0 auto; border-bottom: none; }
.content-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.content-stats {
  padding: 14px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-softer);
}
.content-list {
  flex: 1;
  max-height: 58vh;
  overflow-y: auto;
}

/* ---------- Preview pane (iframe) ---------- */
.preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
}
.preview-url {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Device segmented control (Desktop / Mobile) */
.device-toggle {
  display: inline-flex;
  background: var(--paper-3);
  border-radius: 999px;
  padding: 2px;
  flex: 0 0 auto;
}
.device-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
  cursor: pointer;
  border-radius: 999px;
  font-family: inherit;
  transition: background .12s ease, color .12s ease;
}
.device-btn:hover { color: var(--ink); }
.device-btn.is-active {
  background: #fff;
  color: var(--gee-blue);
  box-shadow: 0 1px 2px rgba(15,23,42,.10);
}

.preview-frame-wrap {
  flex: 1;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.preview-frame-wrap iframe {
  width: var(--device-width, 100%);
  height: 100%;
  min-height: 60vh;
  border: 0;
  display: block;
  background: #fff;
}
.preview-frame-wrap.is-mobile {
  padding: 16px 0;
}
.preview-frame-wrap.is-mobile iframe {
  max-width: 100%;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15,23,42,.12), 0 0 0 8px #1F2937;
}

/* ---------- Контент 2.0 — full-width preview ---------- */
.tab-section.content2-tab {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - 120px);
}
.content2-toolbar {
  display: flex;
  gap: 18px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
}
.c2-tool-group { display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.c2-tool-group .field-label { margin: 0; }
.c2-tool-group .lang-tabs { margin-bottom: 0; border-bottom: none; }
.content2-frame-wrap {
  flex: 1;
  min-height: 60vh;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-2);
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
}
.content2-frame-wrap iframe {
  width: var(--device-width, 100%);
  height: 100%;
  min-height: 60vh;
  border: 0;
  display: block;
  background: #fff;
}
.content2-frame-wrap.is-mobile { padding: 16px 0; }
.content2-frame-wrap.is-mobile iframe {
  max-width: 100%;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15,23,42,.12), 0 0 0 8px #1F2937;
}
.c2-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  padding: 6px 14px;
  background: rgba(15,23,42,.85);
  color: #fff;
  font-size: 12px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0.9;
}

/* ---------- Images-card embedded in Content tab ---------- */
.images-card {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
}
.images-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}
.images-card > summary::-webkit-details-marker { display: none; }
.images-card > summary::before {
  content: "▸";
  font-size: 11px;
  color: var(--mute);
  margin-right: 6px;
  transition: transform .12s ease;
  display: inline-block;
}
.images-card[open] > summary::before { transform: rotate(90deg); }
.images-card-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  flex: 1;
}
.images-zones {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.zone-block {
  border-top: 1px solid var(--line-softer);
  padding-top: 12px;
}
.zone-block:first-child { border-top: none; padding-top: 0; }
.zone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.zone-name { font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.img-tile-edit, .img-tile-empty {
  appearance: none;
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
  text-align: left;
}
.img-tile-edit:hover, .img-tile-empty:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,141,194,.12);
}
.img-tile-edit:active { transform: scale(.98); }
.img-tile-edit .img-thumb {
  display: grid;
  place-items: center;
  background: var(--paper-3);
  aspect-ratio: 1;
  overflow: hidden;
}
.img-tile-edit .img-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.img-tile-edit .img-name {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 500;
  word-break: break-all;
  border-top: 1px solid var(--line-softer);
  background: #fff;
}
.img-tile-empty {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--mute);
  background: var(--paper-2);
  border-style: dashed;
}
.content-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-softer);
  align-items: start;
}
.content-val .field.is-flash {
  animation: cms-flash 1.2s ease-out 1;
}
@keyframes cms-flash {
  0%   { box-shadow: 0 0 0 4px rgba(45,141,194,.45); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 0 rgba(45,141,194,0); border-color: var(--line-soft); }
}
@media (max-width: 760px) { .content-row { grid-template-columns: 1fr; } }
.content-key {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--mute);
  word-break: break-all;
  padding-top: 8px;
}
.content-val .field { font-size: 13px; }

/* ---------- Images tab ---------- */
.img-toolbar { max-width: 540px; margin-bottom: 18px; }
.img-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.img-dropzone {
  border: 2px dashed var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  background: var(--paper-2);
  transition: border-color .15s ease, background .15s ease;
}
.img-dropzone.is-drag { border-color: var(--accent); background: #F0F7FB; }
.img-dropzone-text { font-size: 16px; font-weight: 600; }
.img-dropzone-sub { margin: 8px 0; }
.img-rules { margin-top: 12px; font-size: 12px; }
.img-progress { margin-top: 16px; }
.img-progress-bar {
  height: 6px;
  background: var(--paper-3);
  border-radius: 999px;
  overflow: hidden;
}
.img-progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width .15s ease;
}
.img-progress-bar > #img-progress-fill { background: var(--accent); }
#img-progress-text { font-size: 12px; margin-top: 6px; }
.img-list-title {
  margin: 28px 0 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--mute);
}
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.img-tile {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.img-thumb {
  aspect-ratio: 1;
  background: var(--paper-3);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.img-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-tile figcaption { padding: 8px 10px; }
.img-name { font-size: 12px; font-weight: 600; word-break: break-all; }
.img-meta { font-size: 11px; margin-top: 2px; }

/* ---------- Forms tab ---------- */
.forms-list { display: flex; flex-direction: column; gap: 10px; }
.form-row {
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line-softer);
  border-radius: var(--radius);
}
.form-row-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-row-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.form-row-meta code {
  background: var(--paper-3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}
.badge {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--paper-3);
  border-radius: 999px;
  color: var(--ink);
}
.badge-ok   { background: #DCFCE7; color: #166534; }
.badge-mute { background: var(--paper-3); color: var(--mute); }
.badge-err  { background: #FEE2E2; color: #991B1B; }

.integrations-list { display: grid; gap: 10px; }
.integration-row {
  padding: 14px 16px;
  border: 1px solid var(--line-softer);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.integration-row.is-on { background: #F0F9F4; border-color: #BBF7D0; }
.integration-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.is-on { background: var(--ok); }
.dot.is-off { background: var(--mute); }
.integration-row p { margin: 4px 0; font-size: 13px; }
.integration-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
@media (max-width: 760px) { .integration-fields { grid-template-columns: 1fr; } }
.integration-row code { font-family: ui-monospace, monospace; font-size: 11px; }

/* ---------- Employees tab ---------- */
.user-create-form {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.user-create-form .field-group { margin-bottom: 0; }
@media (max-width: 760px) { .user-create-form { grid-template-columns: 1fr; } }

.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.grid-table th, .grid-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-softer);
}
.grid-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}
.grid-table tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
