:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --text: #17202c;
  --muted: #7a8493;
  --line: rgba(23, 33, 50, .10);
  --line2: rgba(23, 33, 50, .18);
  --blue: #0b57d0;
  --blue2: #1787ff;
  --blue-soft: rgba(11, 87, 208, .08);
  --danger: #d93d56;
  --warn: #aa6b00;
  --good: #168a55;
  --shadow: 0 16px 45px rgba(31, 45, 66, .08);
  --shadow2: 0 8px 25px rgba(31, 45, 66, .12);
  --sidebar: #101726;
  --sidebarText: #e9eef8;
  --radius: 22px;
}

html[data-theme="dark"] {
  --bg: #0c111b;
  --panel: #141b27;
  --text: #ecf1f8;
  --muted: #97a1b1;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .16);
  --blue-soft: rgba(18, 36, 66, .6);
  --shadow: 0 16px 45px rgba(0, 0, 0, .3);
  --sidebar: #090e17;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button, a { color: inherit; }
a { text-decoration: none; }
code, pre, textarea.code-area, #htmlEditor {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.admin-app-page { min-height: 100svh; }

/* Decorative Background Rings */
.admin-rings {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.admin-rings div {
  position: absolute;
  border-radius: 50%;
  border: 90px solid rgba(11, 87, 208, .03);
  width: 650px;
  height: 650px;
  right: -150px;
  top: -200px;
}
html[data-theme="dark"] .admin-rings div {
  border-color: rgba(23, 135, 255, .04);
}

/* Sidebar (Desktop) */
.admin-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 230px;
  background: var(--sidebar);
  color: var(--sidebarText);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  z-index: 30;
  box-shadow: 4px 0 25px rgba(0,0,0,.15);
}
.admin-brand {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 8px 12px 28px;
}
.admin-brand strong { font-size: 1.3rem; letter-spacing: .08em; font-weight: 900; }
.admin-brand span { font-size: .68rem; margin-bottom: 2px; color: #7f8ba0; font-weight: 700; }

.admin-nav { display: grid; gap: 6px; }
.admin-nav button {
  border: 0;
  background: transparent;
  color: #93a0b5;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 750;
  font-size: .85rem;
  transition: all .2s;
}
.admin-nav button:hover, .admin-nav button.active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}
.admin-nav button.active {
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(11, 87, 208, .35);
}
.admin-nav button span { font-size: 1.1rem; }
.admin-nav button i {
  font-style: normal;
  background: #ff3b5c;
  color: #fff;
  min-width: 20px; height: 20px;
  border-radius: 99px;
  display: grid; place-items: center;
  font-size: .65rem;
  font-weight: 900;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 10px 4px;
}
.sidebar-bottom > a, .sidebar-bottom button {
  border: 0;
  background: rgba(255,255,255,.05);
  color: #9caabf;
  font-size: .78rem;
  font-weight: 750;
  padding: 10px 14px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.sidebar-bottom a:hover, .sidebar-bottom button:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}

/* Main Area */
.admin-main {
  margin-left: 230px;
  min-height: 100svh;
  position: relative;
  z-index: 1;
}

/* Topbar */
.admin-topbar {
  height: 86px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.admin-overline {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--blue);
  font-weight: 850;
}
.admin-topbar h1 { font-size: 1.45rem; margin: 4px 0 0; font-weight: 900; }
.admin-top-actions { display: flex; align-items: center; gap: 10px; }
.admin-theme, .admin-user {
  height: 42px;
  border: 1px solid var(--line2);
  background: var(--panel);
  border-radius: 12px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: .78rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.admin-theme { cursor: pointer; }
.admin-user { color: var(--muted); }

/* Main Content Layout */
.admin-content { padding: 32px 36px 80px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.tag {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 850;
}

.panel-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.panel-toolbar h2, .admin-card h2, .admin-card h3 { margin: 6px 0 0; font-weight: 900; }
.panel-toolbar h2 { font-size: 1.75rem; }
.panel-toolbar p, .muted { color: var(--muted); line-height: 1.55; font-size: .88rem; }

/* Dashboard Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.stats-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stats-grid article:after {
  content: "";
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  right: -30px; top: -30px;
  background: var(--blue-soft);
}
.stats-grid span { display: block; color: var(--muted); font-size: .75rem; font-weight: 750; }
.stats-grid strong { display: block; font-size: 2.2rem; margin-top: 10px; font-weight: 900; }

.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.health {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.health.ok { background: #e6f6ee; color: var(--good); }
.health.bad { background: #fff1e8; color: #b45200; }

.health-list { display: grid; gap: 10px; margin-top: 20px; }
.health-list > div {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}

.quick-code { display: grid; gap: 10px; margin-top: 20px; }
.quick-code code {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 14px;
  color: var(--blue);
  font-weight: 700;
}

/* Notices & Flashes */
.notice {
  padding: 16px 18px;
  border: 1px solid var(--line2);
  background: var(--panel);
  border-radius: 16px;
  font-size: .85rem;
  line-height: 1.55;
  margin: 18px 0;
}
.notice.warn { border-color: #f2cf95; background: #fff7e7; color: #7f5400; }
html[data-theme="dark"] .notice.warn { background: #332710; color: #efc873; border-color: #6c5421; }

.flash-stack { display: grid; gap: 10px; }
.page-flashes { margin: 20px 36px 0; }
.flash {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: .85rem;
  font-weight: 700;
}
.flash.success { border-color: #a9e0c6; background: #ecfaf3; color: #166842; }
.flash.error { border-color: #ffc2cb; background: #fff0f2; color: #9c2338; }
.flash.warning { border-color: #f1d098; background: #fff7e7; color: #805300; }

/* Buttons & Inputs */
.admin-primary, .admin-secondary, .danger-btn, .link-btn {
  border: 1px solid transparent;
  border-radius: 13px;
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 850;
  cursor: pointer;
  transition: all .2s;
}
.admin-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 20px rgba(11, 87, 208, .25);
}
.admin-primary:hover { transform: translateY(-2px); }
.admin-secondary { background: var(--panel); border-color: var(--line2); color: var(--text); }
.danger-btn { background: #fff0f2; color: var(--danger); border-color: #ffc7d0; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Custom Styled File Upload Button */
.file-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  background: var(--bg);
  border: 1px dashed var(--blue);
  color: var(--blue);
  border-radius: 12px;
  font-weight: 800;
  font-size: .82rem;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
  text-align: center;
}
.file-upload-btn:hover {
  background: var(--blue-soft);
  border-style: solid;
}
.file-upload-btn input[type="file"] {
  display: none !important;
}

/* Color Picker Input */
.color-picker-input {
  height: 48px;
  padding: 4px 8px;
  cursor: pointer;
}

/* Lead Inbox Table */
.lead-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.lead-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.lead-table th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.lead-table td { padding: 16px; border-bottom: 1px solid var(--line); font-size: .85rem; vertical-align: top; }
.lead-table tr:last-child td { border-bottom: 0; }
.lead-table .lead-new { background: var(--blue-soft); }
.lead-table td strong { display: block; font-size: .95rem; }
.lead-table td small { display: block; color: var(--muted); margin-top: 4px; }
.lead-table select {
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 750;
  cursor: pointer;
}
.lead-table summary { cursor: pointer; color: var(--blue); font-weight: 800; }
.lead-detail { width: 320px; padding: 12px 0; color: var(--muted); }
.lead-detail > div { display: grid; gap: 3px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lead-detail b { color: var(--text); }
.lead-detail pre { white-space: pre-wrap; font-size: .72rem; }
.icon-danger { border: 0; background: transparent; color: var(--danger); font-size: 1.4rem; cursor: pointer; padding: 4px 8px; }
.empty { text-align: center; color: var(--muted) !important; padding: 60px !important; }

/* Slides List */
.slide-list { display: grid; gap: 12px; }
.slide-row {
  display: grid;
  grid-template-columns: 38px minmax(220px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.drag-handle { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; cursor: grab; }
.slide-meta { display: grid; gap: 4px; }
.slide-meta strong { font-size: .95rem; }
.slide-meta code { color: var(--blue); font-size: .78rem; font-weight: 700; }
.slide-meta span { color: var(--muted); font-size: .72rem; }
.slide-state { font-size: .7rem; font-weight: 850; border-radius: 999px; padding: 6px 12px; text-transform: uppercase; }
.slide-state.on { background: #e8f6ef; color: var(--good); }
.slide-state.off { background: #eef0f3; color: #7e8795; }
.slide-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.slide-actions a, .slide-actions button { border: 0; background: transparent; font-size: .8rem; color: var(--blue); font-weight: 800; cursor: pointer; }
.slide-actions .danger-link { color: var(--danger); }

/* Forms & Editors */
.settings-form { display: grid; gap: 20px; width: 100%; }
.form-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}
.form-section h3 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid .wide { grid-column: 1 / -1; }
.settings-form label { display: grid; gap: 8px; font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.settings-form input, .settings-form textarea, .settings-form select, .editor-fields input, #htmlEditor {
  width: 100%;
  border: 1px solid var(--line2);
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 15px;
  outline: none;
  font-weight: 600;
}
.settings-form textarea { min-height: 96px; resize: vertical; }
.settings-form input:focus, .settings-form textarea:focus, .settings-form select:focus, #htmlEditor:focus {
  border-color: var(--blue2);
  box-shadow: 0 0 0 4px rgba(23, 135, 255, .15);
}

.image-field {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
  border-top: 1px dashed var(--line2);
  padding-top: 16px;
}
.image-field img { width: 90px; height: 64px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

.package-editor { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--bg); }
.package-editor h4 { margin: 0 0 14px; font-size: 1rem; }

.save-bar {
  position: sticky;
  bottom: 20px;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  z-index: 10;
  border: 1px solid var(--line);
}

.social-preview {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
  margin-top: 10px;
}
.social-image { height: 200px; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.social-image img { width: 100%; height: 100%; object-fit: cover; }
.social-image span { font-size: 2.5rem; font-weight: 900; letter-spacing: .1em; color: var(--blue); }
.social-preview > div:last-child { padding: 18px; }
.social-preview small { color: var(--muted); font-size: .8rem; }
.social-preview strong { display: block; margin-top: 6px; font-size: 1.05rem; }
.social-preview p { margin: 6px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }

/* Editor Page Layout Proportions */
.editor-page { min-height: 100svh; }
.editor-top {
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}
.editor-top > a { font-size: .85rem; color: var(--blue); font-weight: 850; }
.editor-top > div { display: grid; text-align: center; }
.editor-top > div strong { font-size: 1rem; }
.editor-top > div span { font-size: .7rem; color: var(--muted); }
.editor-top > button { justify-self: end; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); cursor: pointer; }
.editor-flashes { padding: 16px 28px; }

/* Grid ratio: 440px Code Column + Fluid 1fr Live Preview */
.editor-layout {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  min-height: calc(100svh - 76px);
}
.editor-form, .preview-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.editor-form { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

/* Clean 2-Row Layout for Top Editor Fields */
.editor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.editor-fields label {
  display: grid;
  gap: 6px;
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}
.editor-fields-sub {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}
.toggle-label { display: flex !important; align-items: center; gap: 8px; padding-top: 18px; }
.toggle-label input { width: 18px !important; height: 18px; }

.html-editor-label { flex: 1; display: grid; gap: 8px; }
.html-editor-label textarea { min-height: 480px; resize: vertical; font-size: .8rem; line-height: 1.5; }
.preview-panel { display: flex; flex-direction: column; min-height: 720px; }
.preview-head { height: 50px; padding: 0 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.preview-head small { color: var(--blue); font-weight: 750; }
#slidePreview { border: 0; width: 100%; flex: 1; background: #10131c; }

/* Builder Toolbox & Snippets Categorization */
.builder-toolbox {
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.builder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.undo-group { display: flex; gap: 6px; }
.tool-btn {
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
}
.tool-btn:disabled { opacity: .4; cursor: not-allowed; }
.tool-btn:not(:disabled):hover { background: var(--blue-soft); color: var(--blue); }

.snippet-categories { display: grid; gap: 10px; }
.snippet-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.snippet-group small {
  font-size: .68rem;
  font-weight: 850;
  color: var(--muted);
  width: 100%;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.snippet-group button {
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 4px rgba(0,0,0,.02);
}
.snippet-group button:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* Login Page */
.admin-login-page {
  min-height: 100svh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 2; }
.login-card { width: min(100%, 480px); background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: 40px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: flex-end; gap: 8px; }
.login-brand span { font-size: 1.5rem; font-weight: 900; letter-spacing: .08em; }
.login-brand small { color: var(--muted); margin-bottom: 3px; font-weight: 700; }
.login-kicker { margin-top: 36px; color: var(--blue); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 850; }
.login-card h1 { margin: 8px 0 0; font-size: 2.1rem; font-weight: 900; }
.login-card > p { color: var(--muted); line-height: 1.55; font-size: .92rem; }
.login-form { display: grid; gap: 16px; margin-top: 26px; }
.login-form label { display: grid; gap: 8px; font-size: .75rem; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.login-form input { height: 52px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); border-radius: 14px; padding: 0 16px; outline: none; }
.login-help { margin-top: 24px; padding: 14px; border-radius: 14px; background: var(--bg); font-size: .78rem; color: var(--muted); display: grid; gap: 6px; }
.login-help code { color: var(--blue); font-weight: 700; }
.admin-theme-fab { position: fixed; right: 24px; top: 24px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line2); background: var(--panel); color: var(--text); cursor: pointer; z-index: 10; box-shadow: var(--shadow); }


/* ==========================================================================
   MOBILE & TABLET ADAPTATION
   ========================================================================== */

@media (max-width: 1200px) {
  .editor-layout { grid-template-columns: 1fr; }
  .preview-panel { min-height: 580px; }
}

@media (max-width: 1100px) {
  .admin-sidebar { width: 76px; padding: 20px 8px; }
  .admin-brand { padding-inline: 4px; justify-content: center; }
  .admin-brand span { display: none; }
  .admin-nav button { grid-template-columns: 1fr; justify-items: center; padding: 14px 4px; }
  .admin-nav button b { display: none; }
  .admin-nav button i { position: absolute; margin-left: 26px; margin-top: -20px; }
  .sidebar-bottom a, .sidebar-bottom button { font-size: 0; padding: 12px 0; text-align: center; }
  .sidebar-bottom a:before { content: "↗"; font-size: 1.1rem; }
  .sidebar-bottom button:before { content: "⇥"; font-size: 1.1rem; }
  .admin-main { margin-left: 76px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Bottom App Navigation Bar */
  .admin-sidebar {
    position: fixed;
    left: 0; right: 0; top: auto; bottom: 0;
    width: 100%; height: 68px;
    padding: 0;
    background: var(--sidebar);
    border-top: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 -10px 30px rgba(0,0,0,.3);
    z-index: 100;
  }
  .admin-brand, .sidebar-bottom { display: none; }
  .admin-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    gap: 0;
    padding: 0 4px;
  }
  .admin-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    gap: 2px;
    border-radius: 10px;
    color: #8a99ad;
    min-width: 44px;
  }
  .admin-nav button.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    box-shadow: none;
  }
  .admin-nav button span { font-size: 1.2rem; }
  .admin-nav button b { display: block; font-size: .6rem; font-weight: 700; text-align: center; }
  .admin-nav button i { position: static; margin: 0; font-size: .6rem; min-width: 16px; height: 16px; }

  /* Main Layout Adjustment for Bottom Nav */
  .admin-main { margin-left: 0; padding-bottom: 78px; }
  .admin-topbar { height: 72px; padding: 0 16px; }
  .admin-overline { display: none; }
  .admin-topbar h1 { font-size: 1.2rem; }
  .admin-theme span, .admin-user { display: none; }
  .admin-content { padding: 20px 14px 40px; }
  .page-flashes { margin: 14px 14px 0; }

  /* Cards & Forms */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats-grid article { padding: 18px; }
  .stats-grid strong { font-size: 1.7rem; }
  .panel-toolbar { flex-direction: column; gap: 10px; }
  .panel-toolbar .admin-primary, .panel-toolbar .admin-secondary { width: 100%; }

  .form-section, .admin-card { padding: 20px; border-radius: 18px; }
  .form-grid, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .image-field { grid-template-columns: 1fr; gap: 10px; }
  .image-field img { width: 100%; height: 120px; }

  /* Lead Inbox: Mobile Responsive Cards */
  .lead-table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible !important; width: 100% !important; }
  .lead-table { min-width: 0 !important; width: 100% !important; }
  .lead-table, .lead-table tbody, .lead-table tr, .lead-table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }
  .lead-table thead { display: none; }
  .lead-table tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    margin-bottom: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
  }
  .lead-table .lead-new { border-left: 5px solid var(--blue); }
  .lead-table td {
    padding: 6px 0;
    border-bottom: 0;
    font-size: .88rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .lead-table td:first-child { color: var(--muted); font-size: .75rem; font-weight: 800; }
  .lead-table td strong { font-size: 1.1rem; color: var(--blue); margin-top: 2px; }
  .lead-table td select { width: 100%; height: 44px; margin-top: 6px; }
  .lead-detail { width: 100%; }

  /* Slide rows on mobile */
  .slide-row { grid-template-columns: 30px 1fr; gap: 10px; padding: 14px; }
  .slide-state { grid-column: 2; justify-self: start; }
  .slide-actions { grid-column: 1 / -1; justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }

  /* Floating Save Bar above bottom nav */
  .save-bar { bottom: 82px; width: 100%; box-shadow: var(--shadow2); }
  .save-bar .admin-primary { width: 100%; }

  /* Editors on Mobile */
  .editor-top { padding: 0 14px; grid-template-columns: auto 1fr auto; }
  .editor-top > div span { display: none; }
  .editor-layout { padding: 10px; gap: 12px; }
  .editor-form { padding: 14px; }
  .editor-fields { grid-template-columns: 1fr; }
  .editor-fields-sub { grid-template-columns: 1fr 1fr; }
  .toggle-label { grid-column: 1 / -1; padding-top: 0; }
  .html-editor-label textarea { min-height: 420px; }
  .preview-panel { min-height: 480px; }
  .builder-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Builder Toolbox Snippets Draggable Styling */
.snippet-group button[draggable="true"] {
  cursor: grab;
  user-select: none;
}
.snippet-group button[draggable="true"]:active {
  cursor: grabbing;
  opacity: .7;
}