/* Thscpa Newsletter — compact modern admin theme */
:root {
  --brand: #221C17;
  --brand-hover: #3a322c;
  --brand-soft: #f3f1ef;
  --brand-border: #ddd6ce;
  --ink: #1a1714;
  --muted: #6b6560;
  --line: #e8e4df;
  --surface: #ffffff;
  --bg: #f6f4f1;
  --danger: #dc2626;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: none;
  --font: "Plus Jakarta Sans", "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.app-body,
body.auth-page,
.app-body button,
.app-body input,
.app-body select,
.app-body textarea,
.app-body a,
.auth-page button,
.auth-page input {
  font-family: var(--font) !important;
}

body.app-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.015em;
}

body.app-body h1, body.app-body h2, body.app-body h3,
body.app-body h4, body.app-body h5, body.app-body h6,
.auth-page h1 {
  font-family: var(--font) !important;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* Kill Bootstrap-admin ALL CAPS labels everywhere */
.app-body .uppercase,
.app-body .tracking-wider,
.app-body .tracking-widest,
.app-body main label.uppercase,
.app-body main th,
.app-body main .text-\[10px\].uppercase,
.app-body main .text-\[9px\].uppercase,
.app-body main h4.uppercase,
.app-body main .font-bold.uppercase {
  text-transform: none !important;
  letter-spacing: -0.01em !important;
}

/* Keep Font Awesome icons intact */
.app-body .fa, .app-body .fas, .app-body .far, .app-body .fal, .app-body .fab,
.auth-page .fa, .auth-page .fas, .auth-page .far, .auth-page .fal, .auth-page .fab,
.app-body i[class*="fa-"], .auth-page i[class*="fa-"] {
  font-family: "Font Awesome 6 Free" !important;
}
.app-body .fab, .auth-page .fab {
  font-family: "Font Awesome 6 Brands" !important;
}

/* ---- Top navigation ---- */
.app-topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.app-topnav-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.03em;
  max-width: 280px;
}
.app-brand img { height: 28px; max-width: 100px; object-fit: contain; }
.app-brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.app-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}

.app-topnav,
.app-topnav-inner {
  overflow: visible;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.app-nav-link,
.app-nav-btn,
details.app-nav-drop > summary.app-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #4a453f;
  font: inherit;
  font-weight: 650;
  font-size: 13.5px;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
  list-style: none;
  flex-shrink: 0;
}

details.app-nav-drop > summary.app-nav-btn::-webkit-details-marker { display: none; }
details.app-nav-drop > summary.app-nav-btn::marker { content: ""; }

.app-nav-link:hover,
.app-nav-btn:hover,
details.app-nav-drop > summary.app-nav-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.app-nav-link.is-active,
.app-nav-btn.is-active,
details.app-nav-drop > summary.app-nav-btn.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

.app-nav-link > .fas:first-child,
.app-nav-btn > .fas:first-child,
details.app-nav-drop > summary.app-nav-btn > .fas:first-child {
  font-size: 13px;
  width: 1em;
  text-align: center;
}

.app-caret {
  font-size: 10px !important;
  opacity: .7;
  margin-left: 2px;
}

.app-nav-drop {
  position: relative;
  flex-shrink: 0;
}

.app-nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  padding: 8px;
  z-index: 5000;
}

.app-nav-menu-wide { min-width: 240px; }

details.app-nav-drop[open] > .app-nav-menu,
.app-nav-drop.is-open > .app-nav-menu {
  display: block !important;
}

/* Mega menu panel — columns side by side, equal row heights */
.mega-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  padding: 16px;
  z-index: 5000;
  grid-template-columns: repeat(2, 200px);
  gap: 0 20px;
  align-items: start;
  min-width: 0;
}
details.app-nav-drop[open] > .mega-menu {
  display: grid !important;
}
.mega-menu-3 {
  grid-template-columns: repeat(3, 190px);
}
/* Last nav mega (Admin) opens leftward so System/Settings stays on screen */
.app-nav-drop:last-of-type > .mega-menu,
.mega-menu.is-end {
  left: auto;
  /* right: 0; */
}
.mega-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  align-self: start;
}
.mega-label {
  height: 28px;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #8a847c;
  padding: 0 10px;
  margin-bottom: 4px;
  box-sizing: border-box;
}
.mega-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  box-sizing: border-box;
  white-space: nowrap;
}
.mega-menu a span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mega-menu a i {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
.mega-menu a:hover,
.mega-menu a.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}
.mega-menu a:hover i,
.mega-menu a.is-active i { color: var(--brand); }

.app-nav-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
}

.app-nav-menu a i {
  width: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

.app-nav-menu a:hover,
.app-nav-menu a.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}
.app-nav-menu a:hover i,
.app-nav-menu a.is-active i { color: var(--brand); }

/* Settings page section list — do not reuse .app-nav-menu (that is display:none) */
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 14px;
}
.settings-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-weight: 650;
  font-size: 13.5px;
}
.settings-nav a i {
  width: 18px;
  text-align: center;
  color: #94a3b8;
}
.settings-nav a:hover,
.settings-nav a.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}
.settings-nav a:hover i,
.settings-nav a.is-active i { color: var(--brand); }

/* Email settings sections */
.settings-email { display: flex; flex-direction: column; gap: 14px; }
.settings-block {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fafbfc;
  overflow: hidden;
}
.settings-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f6;
  background: #fff;
}
.settings-block-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.settings-block-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}
.settings-block-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}
.settings-hint {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: #8a847c;
  line-height: 1.45;
}
.settings-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  background: #f0fdfa;
}
.settings-callout strong { display: block; font-size: 13px; color: #0f172a; }
.settings-callout p { margin: 2px 0 0; font-size: 12px; color: #475569; }
.settings-code-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
}
.settings-code-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 4px;
}
.settings-code-box code {
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
  word-break: break-all;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.settings-code-box a { color: #5eead4; }
.settings-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-size: 11.5px !important;
}
.settings-link-row a {
  color: #0f766e;
  font-weight: 650;
  font-size: 13px;
  word-break: break-all;
}
.settings-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-tags span {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
}
.settings-tags code { font-size: 12px; color: #0f766e; }

.app-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.app-drop-wrap { position: relative; }

.app-search {
  position: relative;
  width: min(260px, 20vw);
  min-width: 150px;
}

.app-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 12px;
}

.app-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.app-search input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.app-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  font-size: 14px;
}

.app-icon-btn:hover { color: var(--brand); border-color: var(--brand-border); }

.app-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

.app-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
  height: 42px;
}

.app-user-btn:hover { border-color: var(--brand-border); }

.app-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #ccfbf1;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  overflow: hidden;
}

.app-avatar img { width: 100%; height: 100%; object-fit: cover; }

.app-user-meta { text-align: left; line-height: 1.2; }
.app-user-meta strong { display: block; font-size: 13px; color: var(--ink); font-weight: 700; }
.app-user-meta span { display: block; font-size: 11.5px; color: var(--muted); }

.app-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 250px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  padding: 8px;
  z-index: 4000;
}
.app-dropdown.open { display: block; }
.app-dropdown-title {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.app-dropdown-title strong { display: block; font-size: 13.5px; }
.app-dropdown-title span { display: block; font-size: 12px; color: #94a3b8; margin-top: 2px; }
.app-dropdown-empty {
  padding: 16px 10px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  margin: 0;
}

.app-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
}

.app-dropdown a:hover { background: #f8fafc; color: var(--brand); }
.app-dropdown a.is-danger { color: var(--danger); }
.app-dropdown a.is-danger:hover { background: #fef2f2; }

.app-mobile-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

/* ---- Main shell ---- */
.app-body > main,
.app-body main.app-main,
.app-body main.flex-1,
.app-body main.min-w-0 {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 5px 16px 16px !important;
  background: transparent !important;
  flex: none !important;
  min-width: 0;
  box-sizing: border-box;
}

/* ---- Dashboard body (compact, no template cards) ---- */
.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8eef2;
}
.dash-hero h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.dash-hero p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #64748b;
}
.dash-hero-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
}
.dash-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 72px;
  padding: 0 14px;
  border-right: 1px solid #e8eef2;
  text-align: right;
}
.dash-hero-stat:first-child { padding-left: 0; }
.dash-hero-stat:last-child {
  border-right: 0;
  padding-right: 0;
}
.dash-hero-stat strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dash-hero-stat span {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #8a847c;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Toolbar-style quick actions (not cards) */
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.dash-actions a {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  text-decoration: none;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
  border-right: 1px solid #eef2f6;
  background: #fff;
  transition: background .12s, color .12s;
}
.dash-actions a:last-child { border-right: 0; }
.dash-actions a:hover {
  background: #f8fafc;
  color: #0f172a;
}
.dash-actions a i {
  font-size: 11px;
  color: #221C17;
  opacity: .85;
}

.dash-started {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.dash-started-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #eef2f6;
  background: #fafbfc;
}
.dash-started-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1a1714;
  text-transform: none;
  letter-spacing: -0.02em;
}
.dash-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.dash-progress span {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dash-progress-bar {
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  overflow: hidden;
}
.dash-progress-bar i {
  display: block;
  height: 100%;
  background: #221C17;
  border-radius: 2px;
}
.dash-started-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.dash-steps {
  padding: 4px;
  border-right: 1px solid #eef2f6;
  background: #fff;
}
.dash-step {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 8px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  color: #475569;
  transition: background .1s, color .1s;
}
.dash-step:hover { background: #f1f5f9; }
.dash-step.is-active {
  background: #F5F5F5;
  color: #0f172a;
}
.dash-step-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 8px;
}
.dash-step-check.done { background: #221C17; color: #fff; }
.dash-step-check.todo { background: #e2e8f0; color: #94a3b8; }
.dash-step strong {
  font-size: 12.5px;
  font-weight: 650;
  color: inherit;
  line-height: 1.25;
}
.dash-step-panels { min-height: 0; }
.dash-step-detail {
  padding: 12px 14px;
  display: none;
}
.dash-step-detail.is-active { display: block; }
.dash-step-detail h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: #0f172a;
}
.dash-step-detail p {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
  max-width: 520px;
}
.dash-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 4px;
  background: #221C17;
  color: #fff !important;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
}
.dash-cta:hover { background: #3a322c; }
.dash-cta.is-done {
  background: transparent;
  color: #047857 !important;
  border: 1px solid #a7f3d0;
}

/* Single metrics strip — not 4 cards */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.dash-metric {
  padding: 5px 10px;
  border-right: 1px solid #eef2f6;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background .1s;
}
.dash-metric:hover { background: #faf9f7; }
.dash-metric:last-child { border-right: 0; }
.dash-metric-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #8a847c;
  margin-bottom: 2px;
}
.dash-metric-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.dash-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  border-bottom: 1px solid #eef2f6;
  background: #fafbfc;
}
.dash-card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1a1714;
  text-transform: none;
  letter-spacing: -0.02em;
}
.dash-card-head a {
  font-size: 12px;
  font-weight: 650;
  color: #221C17;
  text-decoration: none;
}
.dash-card-head a:hover { text-decoration: underline; }
.dash-card-body { padding: 5px 8px; }

.dash-map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 200px;
  min-height: 180px;
}
#map.dash-map { height: 180px; width: 100%; border: 0; }
.dash-geo-list {
  border-left: 1px solid #eef2f6;
  padding: 6px 10px;
  max-height: 180px;
  overflow: auto;
}
.dash-geo-row {
  display: grid;
  grid-template-columns: 1fr 36px 36px;
  gap: 4px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 11.5px;
}
.dash-geo-row:last-child { border-bottom: 0; }
.dash-geo-row span:first-child {
  font-weight: 600;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-geo-head {
  display: grid;
  grid-template-columns: 1fr 36px 36px;
  gap: 4px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
  padding-bottom: 4px;
  margin-bottom: 0;
}

.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #8a847c;
  font-weight: 650;
  padding: 5px 8px;
}
.dash-table td {
  padding: 5px 8px;
  border-top: 1px solid #efebe6;
  color: #4a453f;
  vertical-align: middle;
  font-weight: 500;
}
.dash-table tr:hover td { background: #fafbfc; }
.dash-person {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  color: #0f172a;
}
.dash-avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}
.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  height: 20px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.dash-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: .85;
}
/* Warm brand tones — not Bootstrap green/blue/red */
.dash-badge.ok {
  background: #f3f0e8;
  color: #5c5346;
  border-color: #e4ddd0;
}
.dash-badge.mute {
  background: #f4f2ef;
  color: #7a746c;
  border-color: #e8e4df;
}
.dash-badge.bad {
  background: #f7ebe6;
  color: #8b4a32;
  border-color: #ead7ce;
}
.dash-badge.warn {
  background: #f1eee8;
  color: #6b5e4e;
  border-color: #ddd5c8;
}
.dash-badge.off {
  background: #f6f4f1;
  color: #9a948c;
  border-color: #ebe7e1;
}

.dash-side-list { display: flex; flex-direction: column; gap: 0; }
.dash-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.dash-side-item:hover { background: #f8fafc; }
.dash-side-item:last-child { border-bottom: 0; }
.dash-side-item div {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 650;
  color: #334155;
}
.dash-side-item i {
  width: 18px;
  text-align: center;
  color: #64748b;
  font-size: 11px;
  background: none;
  height: auto;
  border-radius: 0;
  display: inline;
}
.dash-side-item strong {
  font-size: 12.5px;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.dash-camp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
}
.dash-camp-row:last-child { border-bottom: 0; }
.dash-camp-row a {
  font-size: 12.5px;
  font-weight: 650;
  color: #0f172a;
  text-decoration: none;
}
.dash-camp-row a:hover { color: #221C17; }
.dash-camp-meta { font-size: 11px; color: #94a3b8; margin-top: 1px; }

@media (max-width: 1100px) {
  .dash-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-metric:nth-child(2) { border-right: 0; }
  .dash-metric:nth-child(1),
  .dash-metric:nth-child(2) { border-bottom: 1px solid #eef2f6; }
  .dash-started-body { grid-template-columns: 1fr; }
  .dash-steps {
    border-right: 0;
    border-bottom: 1px solid #eef2f6;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-map-wrap { grid-template-columns: 1fr; }
  .dash-geo-list { border-left: 0; border-top: 1px solid #eef2f6; max-height: 140px; }
}
@media (max-width: 640px) {
  .dash-actions a { flex: 1 1 50%; border-bottom: 1px solid #eef2f6; }
  .dash-metrics { grid-template-columns: 1fr 1fr; }
  .dash-steps { grid-template-columns: 1fr; }
}

.app-main > .page-toolbar,
.app-main > header.legacy-top {
  display: none !important;
}

/* =========================================================
   Global compact page chrome (Dashboard look on every page)
   ========================================================= */

/* Page title row */
.app-body main > .flex.justify-between,
.app-body main > div.flex.justify-between {
  margin-bottom: 10px !important;
  align-items: center !important;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8eef2;
}
.app-body main > .mb-6:has(> h1),
.app-body main > .mb-8:has(> h1),
.app-body main > div > .mb-6:has(> h1),
.app-body main > div > .flex.justify-between {
  margin-bottom: 10px !important;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8eef2;
}
.app-body main h1.text-2xl,
.app-body main h1.text-xl,
.app-body main > .flex.justify-between h1,
.app-body main > div.flex.justify-between h1,
.app-body main > .mb-6 > h1,
.app-body main > .mb-8 > h1,
.app-body main > div > .mb-6 > h1 {
  font-size: 18px !important;
  font-weight: 750 !important;
  letter-spacing: -0.02em !important;
  color: #0f172a !important;
  margin-bottom: 2px !important;
  line-height: 1.25 !important;
}
.app-body main > .flex.justify-between p,
.app-body main > div.flex.justify-between p,
.app-body main > .mb-6 > p,
.app-body main > .mb-8 > p,
.app-body main > div > .mb-6 > p,
.app-body main p.text-gray-400.text-sm,
.app-body main .text-gray-400.text-sm,
.app-body main .text-gray-400.text-xs {
  font-size: 12.5px !important;
  color: #64748b !important;
  margin: 0 !important;
}

/* Spacing rhythm */
.app-body main .mb-8 { margin-bottom: 10px !important; }
.app-body main .mb-6 { margin-bottom: 10px !important; }
.app-body main .mb-5 { margin-bottom: 8px !important; }
.app-body main .mb-4 { margin-bottom: 8px !important; }
.app-body main .mt-8 { margin-top: 10px !important; }
.app-body main .mt-6 { margin-top: 10px !important; }
.app-body main .p-8 { padding: 5px 8px !important; }
.app-body main .p-6 { padding: 5px 8px !important; }
.app-body main .p-5 { padding: 5px 8px !important; }
.app-body main .p-4 { padding: 5px !important; }
.app-body main .px-6 { padding-left: 8px !important; padding-right: 8px !important; }
.app-body main .py-4 { padding-top: 5px !important; padding-bottom: 5px !important; }
.app-body main .py-3 { padding-top: 5px !important; padding-bottom: 5px !important; }
.app-body main .gap-6 { gap: 10px !important; }
.app-body main .gap-4 { gap: 8px !important; }
.app-body main .gap-3 { gap: 6px !important; }

/* Kill template card look */
.app-body main .rounded-2xl,
.app-body main .rounded-xl,
.app-body main .rounded-lg {
  border-radius: 6px !important;
}
.app-body main .shadow-sm,
.app-body main .shadow,
.app-body main .shadow-md {
  box-shadow: none !important;
}
.app-body main .border-gray-100,
.app-body main .border-gray-50 {
  border-color: #e2e8f0 !important;
}
.app-body main .bg-slate-50,
.app-body main .bg-gray-50 {
  background: transparent !important;
}

/* White panels (forms, tables, filters) */
.app-body main > .bg-white,
.app-body main > form.bg-white,
.app-body main > div.bg-white,
.app-body main form.bg-white.rounded-2xl,
.app-body main div.bg-white.rounded-2xl,
.app-body main div.bg-white.rounded-xl {
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
}

/* Section heads inside panels */
.app-body main .border-b.border-gray-50,
.app-body main .border-b.border-gray-100 {
  border-color: #eef2f6 !important;
  background: #fafbfc;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
.app-body main h4.font-bold,
.app-body main h3.font-bold,
.app-body main .font-bold.text-sm.uppercase,
.app-body main h3.text-lg {
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  text-transform: none !important;
  color: #1a1714 !important;
}

/* Settings side nav */
.app-body main .md\:w-64.bg-white,
.app-body main .w-full.md\:w-64 {
  padding: 8px !important;
}
.app-body main nav a.py-3 {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  border-radius: 4px !important;
  font-size: 12.5px !important;
}

/* Template / card galleries — light tiles, not metric strips */
.app-body main article.border.rounded-xl,
.app-body main .template-card,
.app-body main .group-card {
  border-radius: 6px !important;
  box-shadow: none !important;
}

.app-body main .gap-5 { gap: 8px !important; }

/* Stats strip: metric grids (mb-6/mb-8 + card children) → dashboard metrics bar */
.app-body main .grid.mb-6:has(> .bg-white),
.app-body main .grid.mb-8:has(> .bg-white),
.app-body main .grid.mb-6:has(> a.rounded-2xl),
.app-body main .grid.mb-8:has(> a.rounded-2xl),
.app-body main .grid.mb-6:has(> a.p-6),
.app-body main .grid.mb-8:has(> a.p-6),
.app-body main .grid.ui-stats {
  display: grid !important;
  gap: 0 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  overflow: hidden;
  background: #fff !important;
  margin-bottom: 10px !important;
  box-shadow: none !important;
}
.app-body main .grid.mb-6:has(> .bg-white) > *,
.app-body main .grid.mb-8:has(> .bg-white) > *,
.app-body main .grid.mb-6:has(> a.rounded-2xl) > *,
.app-body main .grid.mb-8:has(> a.rounded-2xl) > *,
.app-body main .grid.mb-6:has(> a.p-6) > *,
.app-body main .grid.mb-8:has(> a.p-6) > *,
.app-body main .grid.ui-stats > * {
  border-radius: 0 !important;
  border: 0 !important;
  border-right: 1px solid #eef2f6 !important;
  box-shadow: none !important;
  background: #fff !important;
  padding: 5px 10px !important;
  margin: 0 !important;
}
.app-body main .grid.mb-6:has(> .bg-white) > *:last-child,
.app-body main .grid.mb-8:has(> .bg-white) > *:last-child,
.app-body main .grid.mb-6:has(> a.rounded-2xl) > *:last-child,
.app-body main .grid.mb-8:has(> a.rounded-2xl) > *:last-child,
.app-body main .grid.mb-6:has(> a.p-6) > *:last-child,
.app-body main .grid.mb-8:has(> a.p-6) > *:last-child,
.app-body main .grid.ui-stats > *:last-child {
  border-right: 0 !important;
}

/* Compact numbers in stat cells */
.app-body main .grid.mb-6:has(> .bg-white) .text-2xl,
.app-body main .grid.mb-8:has(> .bg-white) .text-2xl,
.app-body main .grid.mb-6:has(> a) .text-2xl,
.app-body main .grid.mb-8:has(> a) .text-2xl,
.app-body main .grid.ui-stats .text-2xl,
.app-body main .grid.ui-stats .text-3xl,
.app-body main .grid.mb-6:has(> .bg-white) .text-xl,
.app-body main .grid.ui-stats .text-xl {
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  line-height: 1.1 !important;
  color: #0f172a !important;
}
.app-body main .grid.mb-6:has(> .bg-white) .text-\[10px\],
.app-body main .grid.mb-8:has(> .bg-white) .text-\[10px\],
.app-body main .grid.mb-6:has(> a) .text-\[10px\],
.app-body main .grid.ui-stats .text-\[10px\],
.app-body main .grid.ui-stats .text-\[9px\] {
  font-size: 11px !important;
  letter-spacing: .03em !important;
  color: #94a3b8 !important;
}

/* Hide decorative icons in metric strips */
.app-body main .grid.mb-6:has(> .bg-white) > * > .w-10,
.app-body main .grid.mb-8:has(> .bg-white) > * > .w-10,
.app-body main .grid.mb-6:has(> .bg-white) > * > .w-12,
.app-body main .grid.mb-6:has(> a) > * > .w-10,
.app-body main .grid.mb-6:has(> a) > * > .w-12,
.app-body main .grid.mb-8:has(> a) > * > .w-12,
.app-body main .grid.ui-stats > * > .w-10,
.app-body main .grid.ui-stats > * > .w-12,
.app-body main .grid.mb-6:has(> a) > div > div:last-child:has(> i.fas),
.app-body main .grid.mb-8:has(> a) > div > div:last-child:has(> i.fas),
.app-body main .grid.ui-stats > * > i.fas,
.app-body main .grid.mb-6:has(> .bg-white.p-4) > * > .flex > i.fas,
.app-body main .grid.ui-stats > * .flex.items-center.mt-2 > i.fas,
.app-body main .grid.ui-stats > * .flex.justify-between.items-center > i.fas {
  display: none !important;
}

/* Buttons — compact */
.app-body main a.bg-pink-600,
.app-body main button.bg-pink-600,
.app-body main a.bg-white.border,
.app-body main button.bg-white.border,
.app-body main a.px-4.py-2,
.app-body main button.px-4.py-2 {
  min-height: 30px !important;
  padding: 0 12px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: none !important;
}
.app-body main a.bg-white.border,
.app-body main button.bg-white.border {
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

/* Tables */
.app-body main table {
  font-size: 12.5px !important;
}
.app-body main table thead th,
.app-body main table th {
  font-size: 11px !important;
  letter-spacing: -0.01em !important;
  padding: 5px 8px !important;
  color: #8a847c !important;
  font-weight: 650 !important;
  background: transparent !important;
  text-transform: none !important;
}
.app-body main table td {
  padding: 5px 8px !important;
  border-color: #efebe6 !important;
  vertical-align: middle !important;
}
.app-body main table tr:hover td {
  background: #fafbfc !important;
}

/* Badges / pills → compact square-ish */
.app-body main .rounded-full {
  border-radius: 3px !important;
  padding: 1px 6px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
}

/* Labels */
.app-body main label.block.text-xs,
.app-body main label.text-\[10px\],
.app-body main .text-xs.font-bold.text-gray-400 {
  font-size: 11px !important;
  margin-bottom: 4px !important;
  letter-spacing: .03em;
}

/* Inputs inside pages — compact height */
.app-body main input:not([type="checkbox"]):not([type="radio"]),
.app-body main select,
.app-body main textarea {
  min-height: 30px !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  font-size: 12.5px !important;
}
.app-body main textarea { min-height: 72px !important; }

/* Filter form heads */
.app-body main form .text-pink-600,
.app-body main form .flex.items-center.gap-2.mb-6 {
  margin-bottom: 8px !important;
  color: #221C17 !important;
}

/* Nested cards inside create/view pages */
.app-body main .grid > .bg-white.rounded-2xl,
.app-body main .grid > .bg-white.rounded-xl {
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
  border-radius: 6px !important;
}

/* Remap leftover Bootstrap-ish status chips on other pages */
.app-body main .bg-emerald-50.text-emerald-600,
.app-body main .text-emerald-600.bg-emerald-50,
.app-body main span.bg-emerald-50 {
  background: #f3f0e8 !important;
  color: #5c5346 !important;
}
.app-body main .bg-orange-50.text-orange-600,
.app-body main span.bg-orange-50 {
  background: #f1eee8 !important;
  color: #6b5e4e !important;
}
.app-body main .bg-red-50.text-red-600,
.app-body main span.bg-red-50 {
  background: #f7ebe6 !important;
  color: #8b4a32 !important;
}
.app-body main .bg-blue-50,
.app-body main .text-blue-600.bg-blue-50,
.app-body main .bg-indigo-50 {
  background: #f4f2ef !important;
}
.app-body main .text-blue-600,
.app-body main .text-indigo-600 {
  color: #6b5e4e !important;
}
.bg-pink-600, .hover\:bg-pink-700:hover, button.bg-pink-600, a.bg-pink-600 {
  background-color: var(--brand) !important;
}
.hover\:bg-pink-700:hover { background-color: #3a322c !important; }
.text-pink-600, .hover\:text-pink-600:hover, .hover\:text-pink-700:hover {
  color: var(--brand) !important;
}
.bg-pink-50, .bg-pink-50\/50, .bg-pink-50\/60, .hover\:bg-pink-50:hover, .hover\:bg-pink-50\/50:hover {
  background-color: var(--brand-soft) !important;
}
.border-pink-100, .border-pink-200, .hover\:border-pink-200:hover, .border-pink-300 {
  border-color: var(--brand-border) !important;
}
.focus\:ring-pink-500:focus { --tw-ring-color: rgba(34, 28, 23, 0.2) !important; }
.bg-pink-100 { background-color: #f3f0ec !important; }

@media (max-width: 900px) {
  .app-body main .grid.mb-6:has(> .bg-white),
  .app-body main .grid.mb-8:has(> .bg-white),
  .app-body main .grid.mb-6:has(> a.rounded-2xl),
  .app-body main .grid.mb-8:has(> a.rounded-2xl),
  .app-body main .grid.ui-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .app-body main .grid.mb-6:has(> .bg-white) > *:nth-child(2n),
  .app-body main .grid.mb-8:has(> .bg-white) > *:nth-child(2n),
  .app-body main .grid.ui-stats > *:nth-child(2n) {
    border-right: 0 !important;
  }
  .app-body main .grid.mb-6:has(> .bg-white) > *:nth-child(-n+2),
  .app-body main .grid.mb-8:has(> .bg-white) > *:nth-child(-n+2),
  .app-body main .grid.ui-stats > *:nth-child(-n+2) {
    border-bottom: 1px solid #eef2f6 !important;
  }
}

/* ---- Forms & buttons (global polish) ---- */
.app-body input[type="text"],
.app-body input[type="email"],
.app-body input[type="password"],
.app-body input[type="number"],
.app-body input[type="url"],
.app-body input[type="search"],
.app-body input[type="tel"],
.app-body input[type="datetime-local"],
.app-body input[type="date"],
.app-body input:not([type]),
.app-body select,
.app-body textarea {
  border: 1px solid var(--line) !important;
  border-radius: 4px !important;
  background: #faf9f7 !important;
  color: var(--ink) !important;
  font-family: var(--font) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  min-height: 30px !important;
  box-shadow: none !important;
  transition: border-color .12s, background .12s, box-shadow .12s !important;
}

.app-body input:focus,
.app-body select:focus,
.app-body textarea:focus {
  outline: none !important;
  border-color: #a89f93 !important;
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(34, 28, 23, 0.08) !important;
}

.app-body button[type="submit"],
.app-body .btn-primary,
.app-body a.bg-pink-600,
.app-body button.bg-pink-600 {
  border-radius: var(--radius-sm) !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(15, 118, 110, 0.2);
}

.app-body .bg-emerald-600 {
  background-color: #059669 !important;
}
.app-body .bg-gray-800 {
  background-color: #1e293b !important;
}

/* Cards */
.app-body .bg-white.rounded-2xl,
.app-body .bg-white.rounded-xl {
  box-shadow: var(--shadow);
  border-color: var(--line) !important;
}

/* Login page */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 12% 18%, rgba(20, 184, 166, 0.08), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(15, 118, 110, 0.06), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #eef5f4 100%);
  background-image:
    radial-gradient(rgba(148, 163, 184, 0.22) 1px, transparent 1px),
    linear-gradient(180deg, #f8fafc 0%, #eef5f4 100%);
  background-size: 18px 18px, auto;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  padding: 28px 28px 22px;
  position: relative;
  overflow: hidden;
}

.auth-ribbon {
  position: absolute;
  top: 14px;
  right: -28px;
  background: #0f172a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 36px;
  transform: rotate(35deg);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #14b8a6, #221C17);
  color: #fff;
  display: grid;
  place-items: center;
}

.auth-logo strong {
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.auth-card h1 {
  margin: 0 0 4px;
  text-align: center;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.auth-card .sub {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 18px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  height: 42px;
  border: 1px solid #dbe3ea;
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.auth-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.auth-field { margin-bottom: 14px; position: relative; }

.auth-eye {
  position: absolute;
  right: 12px;
  top: 34px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

.auth-btn {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 4px;
  transition: background .15s, transform .1s;
}

.auth-btn:hover { background: var(--brand-hover); }
.auth-btn:active { transform: translateY(1px); }

.auth-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  color: var(--brand);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

.auth-footer {
  text-align: center;
  margin-top: 18px;
  color: #94a3b8;
  font-size: 11px;
}

.auth-alert {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}

.auth-alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.auth-alert.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.auth-top-utils {
  position: fixed;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.auth-chip {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---- Shared page chrome (Contacts-style, reusable) ---- */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px 10px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.035em;
  color: var(--ink);
  line-height: 1.15;
}
.page-head p {
  margin: 3px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.btn-solid,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font) !important;
}
.btn-solid {
  background: var(--brand);
  color: #fff !important;
  border-color: var(--brand);
}
.btn-solid:hover { background: var(--brand-hover); }
.btn-ghost {
  background: #fff;
  color: #4a453f !important;
  border-color: var(--line);
}
.btn-ghost:hover { background: #faf9f7; color: var(--ink) !important; }
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-decoration: none;
  border: 1px solid #e8d5ce;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font) !important;
  background: #f7ebe6;
  color: #8b4a32 !important;
}
.btn-danger:hover { background: #f0ddd4; }

/* ---- View pages ---- */
.view-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.view-layout-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.view-layout-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 8px;
  align-items: start;
}
.view-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-head-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.page-head-back {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #8a847c;
  text-decoration: none;
  margin-top: 1px;
}
.page-head-back:hover { background: #faf9f7; color: var(--ink); }
.page-head-title h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.view-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f3f0e8;
  color: #5c5346;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
  border: 1px solid var(--line);
  overflow: hidden;
  flex-shrink: 0;
}
.view-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.view-profile {
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.view-profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.view-profile h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.view-profile .view-email {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.view-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid #efebe6;
  margin: 0 -12px -10px;
}
.view-mini-stats > div {
  padding: 8px 6px;
  text-align: center;
  border-right: 1px solid #efebe6;
}
.view-mini-stats > div:last-child { border-right: 0; }
.view-mini-stats strong {
  display: block;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.view-mini-stats span {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 550;
  color: #8a847c;
}
.ui-kv {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ui-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f3f0ec;
  font-size: 12.5px;
}
.ui-kv-row:last-child { border-bottom: 0; }
.ui-kv-row > span:first-child {
  color: #8a847c;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ui-kv-row > span:first-child i {
  width: 12px;
  text-align: center;
  opacity: 0.7;
  font-size: 11px;
}
.ui-kv-row > strong,
.ui-kv-row > span:last-child {
  color: #1a1714;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}
.ui-panel-pad {
  padding: 8px 10px 10px;
}
.view-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.view-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: #f3f0e8;
  border: 1px solid #e4ddd0;
  color: #5c5346;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.view-empty {
  padding: 36px 16px;
  text-align: center;
  color: #8a847c;
}
.view-empty i {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
  opacity: 0.45;
}
.view-empty strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: #5c5346;
  margin-bottom: 2px;
}
.view-empty p {
  margin: 0;
  font-size: 12px;
}
.view-preview-frame {
  background: #fff;
  padding: 8px;
}
.view-preview-meta {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: #5c5346;
  line-height: 1.45;
}
.view-preview-meta strong { color: var(--ink); }
.view-preview-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.view-preview-box iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: 420px;
}
.view-check-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.view-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid #f3f0ec;
  cursor: pointer;
  font-size: 12px;
}
.view-check-item:last-child { border-bottom: 0; }
.view-check-item:hover { background: #faf9f7; }
.view-check-item input { margin-right: 6px; }
.view-check-item .name { font-weight: 650; color: var(--ink); }
.view-check-item .email { display: block; font-size: 11px; color: #8a847c; font-weight: 500; }
.view-bar {
  height: 4px;
  background: #efebe6;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}
.view-bar > i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 99px;
}
.view-timeline {
  position: relative;
  padding-left: 14px;
  border-left: 2px solid #e4ddd0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.view-timeline-item { position: relative; }
.view-timeline-item::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e4ddd0;
}
.view-timeline-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}
.view-timeline-item span {
  font-size: 11px;
  color: #8a847c;
}
.dash-metrics.is-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.ui-toast {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1a1714;
  color: #fff;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 550;
  box-shadow: 0 8px 24px rgba(26,23,20,.2);
  max-width: 360px;
}
.ui-toast button {
  background: none;
  border: 0;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  padding: 0 2px;
  margin-left: 4px;
}
@media (max-width: 1100px) {
  .view-layout,
  .view-layout-2,
  .view-layout-side {
    grid-template-columns: 1fr;
  }
  .dash-metrics.is-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ui-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ui-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid #efebe6;
  background: #faf9f7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* Single-row filter toolbar (not a colspan/grid card) */
.ui-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.ui-filters > input,
.ui-filters > select {
  flex: 1 1 120px;
  min-width: 110px;
  max-width: 200px;
  height: 28px;
  min-height: 28px !important;
  padding: 0 5px !important;
  border: 1px solid var(--line) !important;
  border-radius: 4px !important;
  font-size: 12.5px !important;
  font-weight: 500;
  background: #fff !important;
  box-shadow: none !important;
}
.ui-filters > input[name="search"],
.ui-filters > input#date_range {
  flex: 1.2 1 140px;
  max-width: 220px;
}
.ui-filters > .btn-solid,
.ui-filters > .btn-ghost {
  flex: 0 0 auto;
  height: 28px;
  font-size: 12px;
  padding: 0 8px;
}
.ui-filters label { display: none; }
.ui-filter-grid { display: contents; }
.ui-filter-actions {
  display: contents;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row-actions a {
  color: #7a746c;
  font-size: 12.5px;
  text-decoration: none;
}
.row-actions a:hover { color: var(--ink); }
.row-actions a.is-danger:hover { color: #dc2626; }

.ui-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 5px 8px;
  border-top: 1px solid #efebe6;
  background: #faf9f7;
}
.ui-pager-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.ui-pager-meta select {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 6px !important;
  font-size: 12px !important;
  width: auto;
}
.ui-pager-pages {
  display: flex;
  gap: 4px;
  align-items: center;
}
.ui-pager-pages a {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #4a453f;
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
}
.ui-pager-pages a.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.ui-pager-pages a.is-disabled {
  opacity: .35;
  pointer-events: none;
}

.dash-table th {
  text-transform: none !important;
  letter-spacing: -0.01em !important;
  font-weight: 650 !important;
  font-size: 11.5px !important;
}

/* ---- Compact form pages (create/edit) ---- */
.ui-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}
.ui-form-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ui-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ui-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ui-field > label {
  font-size: 11.5px;
  font-weight: 650;
  color: #6b6560;
  letter-spacing: -0.01em;
  margin: 0;
}
.ui-form-body input[type="text"],
.ui-form-body input[type="email"],
.ui-form-body input[type="url"],
.ui-form-body input[type="number"],
.ui-form-body input[type="date"],
.ui-form-body input[type="datetime-local"],
.ui-form-body input[type="password"],
.ui-form-body input[type="tel"],
.ui-form-body input:not([type]),
.ui-form-body select,
.ui-form-body textarea {
  width: 100%;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 8px !important;
  border: 1px solid var(--line) !important;
  border-radius: 4px !important;
  background: #faf9f7 !important;
  color: var(--ink) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  font-family: var(--font) !important;
  box-shadow: none !important;
  transition: border-color .12s, background .12s !important;
}
.ui-form-body textarea {
  height: auto !important;
  min-height: 72px !important;
  padding: 6px 8px !important;
  resize: vertical;
}
.ui-form-body input:focus,
.ui-form-body select:focus,
.ui-form-body textarea:focus {
  outline: none !important;
  border-color: #a89f93 !important;
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(34, 28, 23, 0.08) !important;
}
.ui-form-body input::placeholder {
  color: #a89f93 !important;
  font-weight: 500;
}
.ui-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
}
.ui-check-grid.is-boxed {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #faf9f7;
}
.ui-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: #4a453f;
  margin: 0;
}
.ui-check input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: var(--brand);
  border-radius: 3px;
  flex-shrink: 0;
}
.ui-empty {
  margin: 0;
  font-size: 12.5px;
  color: #8a847c;
}
.ui-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 5px 0 12px;
}

/* Import page — ~col-8 of main content */
.ui-import {
  /* width: 66.666%; */
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (max-width: 900px) {
  .ui-import { width: 100%; }
}
.ui-note {
  background: #f3f0e8;
  border: 1px solid #e4ddd0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #5c5346;
}
.ui-note strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #1a1714;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.ui-note ul {
  margin: 0 0 6px;
  padding-left: 16px;
  line-height: 1.45;
}
.ui-note li { margin: 0; }
.ui-note-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ui-note-cols span {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 3px;
  background: #ebe6db;
  border: 1px solid #ddd5c8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #5c5346;
}
.ui-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 120px;
  padding: 16px 10px;
  border: 1px dashed #cfc7bb;
  border-radius: 6px;
  background: #faf9f7;
  cursor: pointer;
  text-align: center;
  transition: border-color .12s, background .12s;
}
.ui-dropzone:hover {
  border-color: #a89f93;
  background: #f3f0e8;
}
.ui-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  min-height: 0 !important;
}
.ui-dropzone i {
  font-size: 22px;
  color: #8a847c;
  margin-bottom: 2px;
}
.ui-dropzone strong {
  font-size: 13px;
  font-weight: 700;
  color: #1a1714;
  letter-spacing: -0.02em;
}
.ui-dropzone span {
  font-size: 11.5px;
  color: #8a847c;
  font-weight: 500;
}
.ui-dropzone em {
  margin-top: 4px;
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
  color: #5c5346;
}
.ui-alert {
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 550;
  border: 1px solid transparent;
}
.ui-alert.is-bad {
  background: #f7ebe6;
  border-color: #ead7ce;
  color: #8b4a32;
}
.ui-alert.is-ok {
  background: #f3f0e8;
  border-color: #e4ddd0;
  color: #5c5346;
}
.dash-metric.is-active {
  background: #f3f0e8;
}
.ui-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(26, 23, 20, 0.4);
  display: grid;
  place-items: center;
  padding: 16px;
}
.ui-modal[hidden] { display: none !important; }
.ui-modal-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(26, 23, 20, 0.18);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
}
.ui-modal-card .ui-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.ui-modal-x {
  font-size: 18px;
  line-height: 1;
}

/* Right-side offcanvas (create forms) */
.ui-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(26, 23, 20, 0.35);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ui-offcanvas[hidden] { display: none !important; }
.ui-offcanvas.is-open {
  opacity: 1;
  pointer-events: auto;
}
.ui-offcanvas-panel {
  width: min(420px, 100vw);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(26, 23, 20, 0.14);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.ui-offcanvas-panel.ui-offcanvas-wide {
  width: min(520px, 100vw);
}
.ui-offcanvas.is-open .ui-offcanvas-panel {
  transform: translateX(0);
}
.ui-offcanvas-panel .ui-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.ui-offcanvas-panel .ui-form-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: none;
}
.ui-offcanvas-panel .qm-rule.ui-field-row {
  align-items: center;
}
.ui-offcanvas-panel .ui-form-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 12px !important;
  border-top: 1px solid var(--line);
  margin: 8px -16px -18px;
  padding-left: 16px !important;
  padding-right: 16px !important;
  padding-bottom: 14px !important;
}
#app-confirm-modal .ui-confirm-body {
  padding: 14px 14px 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: #4a453f;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
#app-confirm-modal .ui-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 14px 14px;
}
#app-confirm-modal .ui-confirm-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f0e8;
  color: #6b5e4e;
  display: grid;
  place-items: center;
  font-size: 14px;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .ui-form-grid { grid-template-columns: 1fr; }
  .ui-field-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .ui-filters > input,
  .ui-filters > select {
    max-width: none;
    flex: 1 1 calc(50% - 6px);
  }
  .dash-metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .ui-filters > input,
  .ui-filters > select {
    flex: 1 1 100%;
  }
  .page-head-actions { width: 100%; }
  .ui-check-grid { grid-template-columns: 1fr; }
}



/* ---- Campaign wizard ---- */
.wiz-steps {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.wiz-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  color: #8a847c;
}
.wiz-step:last-child { border-right: 0; }
.wiz-step:hover { background: #faf9f7; }
.wiz-step.is-active {
  background: #e8efe6;
  color: var(--ink);
  box-shadow: inset 0 -2px 0 #2f5d50;
}
.wiz-step.is-done { color: #5c5346; }
.wiz-step-num {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 750;
  flex-shrink: 0;
  background: #fff;
}
.wiz-step.is-active .wiz-step-num {
  background: #2f5d50;
  border-color: #2f5d50;
  color: #fff;
}
.wiz-step.is-done .wiz-step-num {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.wiz-step-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.wiz-step-sub {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: #8a847c;
  margin-top: 1px;
}
.wiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #efebe6;
}
.wiz-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.wiz-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
}
.wiz-choice label:has(input:checked) {
  border-color: #cfc6b8;
  background: #f3f0e8;
}
.wiz-choice input { margin: 0; }
.wiz-choice strong {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}
.wiz-choice span {
  display: block;
  font-size: 11px;
  color: #8a847c;
  font-weight: 500;
}
.wiz-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.wiz-pick {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  cursor: pointer;
  background: #fff;
  text-align: left;
}
.wiz-pick:hover { background: #faf9f7; }
.wiz-pick.is-on {
  border-color: #2f5d50;
  background: #eef5ec;
  box-shadow: inset 0 0 0 1px #2f5d50;
}
.wiz-pick-thumb {
  position: relative;
  height: 108px;
  border-radius: 4px;
  background: #f3f0e8;
  border: 1px solid #efebe6;
  display: grid;
  place-items: center;
  color: #8a847c;
  margin-bottom: 6px;
  font-size: 20px;
  overflow: hidden;
}
.wiz-pick-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wiz-pick-preview {
  position: absolute;
  inset: 0;
  width: 200%;
  height: 200%;
  border: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: top left;
  background: #fff;
}
.wiz-pick em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 650;
  color: #8a847c;
  margin-bottom: 2px;
}
.wiz-pick strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.wiz-pick p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #8a847c;
}
.wiz-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  margin-bottom: 4px;
}
.wiz-group:hover { background: #faf9f7; }
.wiz-group.is-on {
  border-color: #cfc6b8;
  background: #f3f0e8;
}
.wiz-group input { margin: 0; }
.wiz-group strong {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}
.wiz-group span {
  display: block;
  font-size: 11px;
  color: #8a847c;
}
.wiz-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wiz-box {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  background: #fff;
}
.wiz-box.is-add { border-color: #d7e0d0; background: #f7f9f5; }
.wiz-box.is-rm { border-color: #ead7ce; background: #faf6f4; }
.wiz-box h4 {
  margin: 0 0 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.wiz-box p {
  margin: 0 0 6px;
  font-size: 11px;
  color: #8a847c;
}
.wiz-box .view-check-list {
  max-height: 240px;
  background: #fff;
}
.tpl-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.tpl-editor-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 8px;
  border-bottom: 1px solid #efebe6;
  background: #faf9f7;
}
.tpl-hint {
  margin: 0;
  padding: 6px 10px;
  font-size: 11.5px;
  color: #6b6560;
  background: #f7f9f5;
  border-bottom: 1px solid #e4eadf;
}
.tpl-hint strong { color: #1f3d34; }
.tpl-ck.cke {
  border: 0 !important;
  box-shadow: none !important;
}
.tpl-ck .cke_top {
  background: #faf9f7 !important;
  border-bottom: 1px solid #efebe6 !important;
  padding: 4px 4px 2px !important;
}
.tpl-ck .cke_bottom {
  background: #faf9f7 !important;
  border-top: 1px solid #efebe6 !important;
}
.tpl-ck .cke_toolgroup {
  border-color: #e4ddd0 !important;
  background: #fff !important;
  border-radius: 4px !important;
  margin: 2px !important;
}
#html-area .cke_chrome {
  border: 0 !important;
}
.tpl-editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid #efebe6;
  background: #faf9f7;
}
.tpl-editor-tools .tool,
.tpl-mode {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 11.5px;
  font-weight: 650;
  color: #5c5346;
  cursor: pointer;
  font-family: var(--font);
}
.tpl-mode.is-on,
.tpl-editor-tools .tool:hover {
  background: #eef5ec;
  border-color: #b9cbb6;
  color: #1f3d34;
}
.tpl-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid #efebe6;
}
.tpl-tags > span {
  font-size: 11px;
  font-weight: 650;
  color: #8a847c;
  margin-right: 2px;
}
.tpl-tag {
  height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid #e4ddd0;
  background: #f3f0e8;
  color: #5c5346;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, monospace;
  cursor: pointer;
}
.tpl-tag:hover { background: #ebe6da; }
#editor {
  min-height: 420px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  outline: none;
}
#editor:empty:before {
  content: attr(data-placeholder);
  color: #8a847c;
}
.tpl-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.tpl-status label {
  cursor: pointer;
}
.tpl-status input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-status span {
  display: block;
  text-align: center;
  height: 32px;
  line-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 650;
  color: #5c5346;
  background: #fff;
}
.tpl-status input:checked + span {
  background: #eef5ec;
  border-color: #b9cbb6;
  color: #1f3d34;
}
.tpl-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 88px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  background: #faf9f7;
  color: #8a847c;
  font-size: 11.5px;
  cursor: pointer;
}
.tpl-drop:hover { background: #f3f0e8; }
.hidden { display: none !important; }
@media (max-width: 900px) {
  .wiz-steps { flex-wrap: wrap; }
  .wiz-step { flex: 1 1 40%; border-bottom: 1px solid var(--line); }
  .wiz-choice, .wiz-pick-grid, .wiz-split, .tpl-layout { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app-mobile-toggle { display: grid; place-items: center; }
  .app-topnav-inner {
    padding: 0 12px;
    gap: 8px;
    min-height: 52px;
  }
  .app-nav {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: 56px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    flex-direction: column;
    align-items: stretch;
    max-height: 70vh;
    overflow: auto;
    box-shadow: var(--shadow);
    z-index: 60;
  }
  .app-nav.open { display: flex; }
  .app-nav-link, .app-nav-btn,
  details.app-nav-drop > summary.app-nav-btn { width: 100%; justify-content: space-between; }
  .app-nav-menu,
  .mega-menu {
    position: static !important;
    box-shadow: none !important;
    border: 0 !important;
    padding: 6px 0 8px 6px !important;
    min-width: 0 !important;
  }
  details.app-nav-drop[open] > .app-nav-menu { display: block !important; }
  details.app-nav-drop[open] > .mega-menu {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
    width: 100%;
  }
  .mega-menu-3 { grid-template-columns: 1fr !important; }
  .mega-menu a { white-space: normal; height: auto; min-height: 40px; max-height: none; padding: 10px 12px; }
  .app-search { display: none; }
  .app-user-meta { display: none; }
  .app-body > main,
  .app-body main.app-main,
  .app-body main.flex-1,
  .app-body main.min-w-0 {
    padding: 8px 12px 20px !important;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-head-actions {
    width: 100%;
  }
  .page-head-actions .btn-solid,
  .page-head-actions .btn-ghost,
  .page-head-actions .btn-danger {
    flex: 1 1 auto;
  }
  /* Tables scroll horizontally instead of breaking layout */
  .app-body main .ui-panel,
  .app-body main .bg-white,
  .app-body main div:has(> table),
  .app-body main form:has(table) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-body main table {
    min-width: 560px;
  }
  .settings-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .settings-nav a {
    flex: 1 1 auto;
    min-width: calc(50% - 4px);
  }
  .settings-code-box {
    overflow-x: auto;
  }
  .ui-import { width: 100%; }
  .wiz-steps { flex-wrap: wrap; }
  .dash-map-wrap { min-height: 0; }
}

@media (max-width: 640px) {
  .app-top-actions { gap: 6px; }
  .app-dropdown {
    right: 0;
    left: auto;
    width: min(280px, calc(100vw - 24px));
  }
  .ui-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .ui-filters > input,
  .ui-filters > select,
  .ui-filters > button,
  .ui-filters > a {
    width: 100%;
    max-width: none;
    flex: 1 1 100%;
  }
  .page-head h1 { font-size: 18px; }
  .dash-metrics { grid-template-columns: 1fr 1fr; }
  .ui-check-grid { grid-template-columns: 1fr !important; }
  .ui-form-footer {
    flex-direction: column;
    align-items: stretch !important;
  }
  .ui-form-footer .btn-solid,
  .ui-form-footer .btn-ghost {
    width: 100%;
  }
  .auth-card { margin: 12px; }
}

/* Bulk select */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #faf9f7;
}
.bulk-bar.is-on {
  background: #f3f0e8;
  border-bottom-color: #e4ddd0;
}
.bulk-bar-meta {
  font-size: 12.5px;
  font-weight: 650;
  color: #4a453f;
}
.bulk-bar-meta strong { color: var(--ink); }
.bulk-delete-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.dash-table th.bulk-col,
.dash-table td.bulk-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
  vertical-align: middle !important;
  padding-left: 10px !important;
  padding-right: 6px !important;
}
.dash-table input.bulk-id,
.dash-table .bulk-select-all {
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0 !important;
  cursor: pointer;
  accent-color: var(--brand);
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
