/* LEADSORBIT design tokens — sampled from leadsorbit.ai (Tailwind theme) */
:root {
  --blue: #4889FF;
  --blue-dark: #3a78ec;
  --navy: #0D3056;
  --ink: #333333;
  --pink: #FC577B;
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-strong: #D1D5DB;
  --tint: #E8F3FA;
  --tint-2: #CEE5F9;
  --card: #FFFFFF;
  --page: #F4F9FD;
  --footer: #010236;
  --purple: #1b19a6;
  --rail: #FFFFFF;
  --rail-hover: #EEF5FF;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-btn: 0 10px 15px -10px rgba(0, 0, 0, 0.43);
  --shadow-card: 0 4px 24px rgba(13, 48, 86, 0.06);
  --gradient-brand: linear-gradient(100deg, #1b19a6, #4889FF, #FC577B);
  --heading: var(--navy);
  --page-gutter: clamp(24px, 4vw, 48px);
  --content-max: 1120px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: Poppins, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  display: flex;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.rail {
  width: 258px;
  flex: 0 0 258px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  box-shadow: 2px 0 16px rgba(13, 48, 86, 0.04);
}

.rail .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 18px;
}

.rail .brand img { height: 30px; width: auto; }

.rail .newbtn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  box-shadow: var(--shadow-btn);
  transition: background 0.2s ease, transform 0.2s ease;
}

.rail .newbtn:hover {
  background: var(--pink);
  transform: translateY(-2px);
}

.rail .sect {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 20px 10px 7px;
}

.rail .links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.rail .links a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease;
}

.rail .links a:hover { background: var(--rail-hover); }

.rail .links a.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

.rail .foot {
  margin-top: auto;
  padding: 12px 10px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---- Stage + top bar (matches site header) ---- */
.stage {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, var(--tint) 0%, #fff 280px);
}

.topbar {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 var(--page-gutter);
  box-shadow: 0 2px 12px rgba(13, 48, 86, 0.04);
}

.topbar-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 12px;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}

.topbar-title span {
  display: inline-block;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.topbar a.topbar-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  transition: border-color 0.15s, color 0.15s;
}

.topbar a.topbar-link:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.stage > main {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

main { padding: 32px var(--page-gutter) 48px; }
.wrap { max-width: var(--content-max); margin: 0 auto; }

/* ---- Typography ---- */
h1 {
  color: var(--navy);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.sub {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.6;
}

/* ---- Cards & buttons ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.btn {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 22px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: var(--shadow-btn);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background: var(--pink);
  transform: translateY(-2px);
}

.btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--rail-hover);
  border-color: var(--blue);
  color: var(--navy);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.err {
  background: #fff1f4;
  color: #b3244a;
  border: 1px solid #ffd4de;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
}

/* ---- Forms ---- */
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin: 0 0 5px;
}

table { width: 100%; border-collapse: collapse; }
a { color: var(--blue); }
a:hover { color: var(--pink); }
.muted { color: var(--muted); font-size: 13px; }

/* ---- Image grid / edit ---- */
.imgcell.selectable,
.img-select-card.selectable {
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.imgcell.selected,
.img-select-card.selected {
  outline: 2px solid var(--blue);
  box-shadow: 0 0 0 3px rgba(72, 137, 255, 0.15);
}

.edit-hint { font-size: 12px; margin: 8px 0 10px; }

.edit-form {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: var(--tint);
}

.edit-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.edit-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
  min-height: 52px;
  background: #fff;
}

.edit-form .btn { width: 100%; font-size: 12.5px; padding: 7px 12px; }

.progress-track {
  height: 8px;
  background: var(--tint-2);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  transition: width 0.4s ease;
  border-radius: 6px;
}

.badge-pill {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 820px) {
  .rail { display: none; }
  .topbar { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
