:root {
  --blue: #3157d5;
  --blue-dark: #2448b8;
  --navy: #13224a;
  --sky: #f4f7fc;
  --yellow: #ffd84d;
  --white: #fff;
  --text: #18213a;
  --muted: #68728a;
  --danger: #b42318;
  --success: #137a47;
  --border: #dce3f0;
  --focus: #afc2ff;
  --shadow: 0 12px 32px rgba(19, 34, 74, .10);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--sky); font-family: Inter, Arial, sans-serif; line-height: 1.5; }
a { color: var(--blue-dark); }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); font-weight: 900; text-decoration: none; }
.brand-logo { width: 44px; height: 44px; border-radius: 15px; object-fit: cover; display: block; flex-shrink: 0; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 15px; background: var(--blue); color: white; font-size: 24px; }
.nav-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 700; }
main { min-height: calc(100vh - 160px); }
.hero { padding: 72px 0 54px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.eyebrow { display: inline-block; padding: 7px 12px; border-radius: 999px; background: #dbe5ff; color: var(--blue-dark); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
h1 { margin: 18px 0; color: var(--navy); font-size: clamp(38px, 7vw, 72px); line-height: 1.02; letter-spacing: -.04em; }
h2 { color: var(--navy); font-size: clamp(26px, 4vw, 42px); line-height: 1.15; }
h3 { color: var(--navy); }
.lead { max-width: 700px; color: var(--muted); font-size: 19px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.button, button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--blue); color: white; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { background: var(--blue-dark); }
.button.secondary { color: var(--navy); background: var(--yellow); }
.button.ghost { color: var(--navy); background: #d9e4ff; font-weight: 800; }
.button.ghost:hover { background: #c8d6ff; }
.button.button-danger {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}
.button.button-danger:hover { background: #912018; border-color: #912018; }
.hero-card, .card, .form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card { padding: 28px; transform: rotate(1.5deg); }
.robot-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(220px, 100%); margin: 0 auto 18px; }
.robot-art span { display: block; aspect-ratio: 1; border-radius: 18px; background: linear-gradient(145deg, #dbe5ff, #8ea8ff); border: 2px solid #c7d5ff; }
.robot-art span:nth-child(2) { transform: translateY(-8px); background: linear-gradient(145deg, #fff8d6, #ffd84d); border-color: #ffe58a; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-bottom: 48px; }
.step-card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.step-card strong { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #e7edff; color: var(--blue-dark); }
.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.breadcrumb a { color: var(--blue-dark); text-decoration: none; font-weight: 700; }
.field-error { color: var(--danger); font-size: 13px; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .checkbox.has-error { border-color: var(--danger); }
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice-card { display: grid; gap: 8px; padding: 16px; border: 2px solid var(--border); border-radius: 16px; background: #fbfcff; cursor: pointer; min-height: 44px; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card.is-selected, .choice-card:has(input:checked) { border-color: var(--blue); background: #eef3ff; box-shadow: inset 0 0 0 1px var(--blue); }
.choice-card__title { font-weight: 800; color: var(--navy); }
.choice-card__text { color: var(--muted); font-size: 14px; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a.button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.progress { height: 8px; border-radius: 999px; background: #e7edff; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--blue); }
.progress.health-insufficient span { background: #9aa3b5; }
.progress.health-launchable span { background: #e6b800; }
.progress.health-profitable span { background: #137a47; }
.progress.health-target span { background: #0d5c36; }
.group-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.group-finance-hint { margin: 8px 0 0; }
.group-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.group-card__head h3 { margin: 0; }
.group-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.group-edit-panel { margin-top: 16px; border-top: 1px solid var(--border, #e5e7eb); padding-top: 12px; }
.group-edit-panel summary { cursor: pointer; font-weight: 600; color: var(--primary, #2563eb); margin-bottom: 12px; }
.group-edit-form { margin-top: 12px; }
.finance-group-card ul { margin: 0; padding: 0; list-style: none; }
.finance-group-stats li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.finance-group-stats li:last-child { border-bottom: 0; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.record-list { display: none; gap: 12px; }
.record-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.record-card h3 { margin: 0 0 8px; font-size: 18px; }
.record-card.lead-ungrouped,
tr.lead-ungrouped td {
  background: #fff8e8;
}
.record-card.lead-ungrouped {
  border-color: #f0d58a;
  box-shadow: inset 3px 0 0 #e6b422;
}
tr.lead-ungrouped td:first-child {
  box-shadow: inset 3px 0 0 #e6b422;
}
.badge.ungrouped { background: #fff3c4; color: #704f00; }
.record-meta { display: grid; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.feature-grid, .choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; padding-bottom: 72px; }
.card { padding: 28px; }
.card p { color: var(--muted); }
.form-wrap { padding: 54px 0 80px; }
.form-head { max-width: 760px; margin-bottom: 26px; }
.form-head h1 { font-size: clamp(36px, 6vw, 60px); }
.form-card { padding: clamp(22px, 5vw, 48px); }
.form-section { padding: 8px 0 24px; border: 0; margin: 0 0 22px; border-bottom: 1px solid var(--border); }
.form-section legend { padding: 0; margin-bottom: 18px; color: var(--navy); font-weight: 900; font-size: 22px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { font-weight: 750; }
input, select, textarea { width: 100%; min-height: 48px; border: 1px solid #bac6db; border-radius: 12px; padding: 11px 13px; background: white; color: var(--text); font: inherit; }
textarea { min-height: 108px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #ccd8ff; border-color: var(--blue); }
input[type="checkbox"], input[type="radio"] {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  border-radius: 4px;
  flex-shrink: 0;
  accent-color: var(--blue);
}
.checkbox { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 14px 0; font-weight: 500; }
.checkbox input { width: 20px !important; min-height: 20px !important; height: 20px !important; max-width: 20px !important; margin-top: 2px; }
.col-check { width: 52px; white-space: nowrap; }
.col-age { white-space: nowrap; }
table .row-check {
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
}
.hint { color: var(--muted); font-size: 13px; }
.required { color: var(--danger); }
.errors { padding: 14px 18px; margin-bottom: 20px; border-radius: 14px; background: #ffebe9; color: var(--danger); }
.errors ul { margin: 6px 0; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.conditional[hidden] { display: none; }
.success-box { max-width: 720px; margin: 80px auto; text-align: center; }
.success-icon { font-size: 72px; }
.legal { max-width: 850px; margin: 52px auto 80px; }
.legal-content { white-space: pre-wrap; }
.legal-content.legal-html { white-space: normal; }
.legal-content.legal-html h2 { margin: 1.4em 0 0.6em; font-size: 1.15rem; }
.legal-content.legal-html p,
.legal-content.legal-html li { line-height: 1.55; }
.legal-content.legal-html table { width: 100%; border-collapse: collapse; margin: 0.8em 0; font-size: 0.95rem; }
.legal-content.legal-html th,
.legal-content.legal-html td { border: 1px solid #ddd; padding: 0.4em 0.55em; text-align: left; vertical-align: top; }
.site-footer { padding: 28px 0; background: var(--navy); color: #dce5ff; text-align: center; }
.site-footer a { color: #dce5ff; }

/* Admin */
.admin-body { background: #f4f6fb; }
.admin-body .container { width: min(1600px, calc(100% - 48px)); }
.admin-header { background: var(--navy); color: white; }
.admin-header .brand { color: white; }
.admin-books-quick {
  background: #0f2444;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 15;
}
.admin-books-quick__inner {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
}
.admin-books-quick .button {
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; position: relative; z-index: 40; }
.admin-nav a { color: #fff; text-decoration: none; font-weight: 700; }
.admin-nav > a.is-current,
.admin-nav-group.is-current > summary { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.admin-nav-group { position: relative; }
.admin-nav-group summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.admin-nav-group summary::-webkit-details-marker { display: none; }
.admin-nav-group summary::after { content: "▾"; font-size: 11px; opacity: .9; }
.admin-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 188px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 30;
}
.admin-nav .admin-nav-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--navy);
  font-weight: 700;
}
.admin-nav .admin-nav-menu a:hover,
.admin-nav .admin-nav-menu a.is-active { background: #eef3ff; color: var(--blue-dark); }
.admin-header .link-button {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 0;
}
.admin-header .link-button:hover,
.admin-header .link-button:focus-visible {
  background: transparent;
  color: #fff;
  filter: brightness(1.08);
}
.link-button {
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  color: var(--blue-dark) !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  box-shadow: none;
}
.link-button:hover,
.link-button:focus-visible {
  background: transparent !important;
  color: #1a3580 !important;
  text-decoration: underline;
}
.link-button--danger {
  color: #8a1f1f !important;
}
.link-button--danger:hover,
.link-button--danger:focus-visible {
  color: #6b1212 !important;
  background: transparent !important;
}
.admin-main .hint { color: #4a5568; }
.admin-title__meta { color: #3d4a63; font-weight: 600; }
.admin-title__meta a { font-weight: 700; }
.password-plain {
  font-size: 14px;
  letter-spacing: 0.02em;
  user-select: all;
  background: #eef3ff;
  padding: 2px 6px;
  border-radius: 6px;
}
.admin-main { padding: 34px 0 70px; }
.admin-choices { margin-top: 22px; }
.admin-title { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 22px; }
.admin-title h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); }
.admin-title-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat { padding: 24px; background: white; border: 1px solid var(--border); border-radius: 18px; }
.stat strong { display: block; color: var(--navy); font-size: 40px; }
.schedule-filters .button.ghost.is-active,
.stats + .card .button.ghost.is-active {
  background: #eef3ff;
  border-color: var(--blue-dark, #1a3a6b);
  color: var(--blue-dark, #1a3a6b);
}
.toolbar { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 10px; padding: 16px; background: white; border: 1px solid var(--border); border-radius: 16px; margin-bottom: 16px; }
.toolbar button { min-height: 44px; }
.toolbar--groups { grid-template-columns: 2fr repeat(5, minmax(0, 1fr)) auto; }
.bulk-bar { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 12px; align-items: center; padding: 14px 16px; background: #e7edff; border-radius: 16px; }
.bulk-bar .checkbox { margin: 0; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--border); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; }
.mini-table th, .mini-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.mini-table th { color: var(--muted); font-weight: 600; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; background: #e9eeff; color: var(--blue-dark); font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.new { background: #fff3c4; color: #704f00; }
.badge.accepted, .badge.enrolled, .badge.active { background: #dff7e9; color: var(--success); }
.badge.rejected, .badge.archived { background: #f4e6e6; color: #7c2727; }
.detail-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 22px; }
.detail-list { display: grid; grid-template-columns: 180px 1fr; gap: 10px 18px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.lead-group-missing { color: var(--danger); font-weight: 700; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-head h2 { margin: 0; }
.card-head-action { margin: 0; flex-shrink: 0; }
.card-head-action .button,
.card-head-action button {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.lead-master-card .notice,
.lead-master-card .errors { margin: 0 0 10px; }
.lead-sync-line { margin: 0 0 10px; }
.lead-section-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead-section-rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0 12px;
}
.detail-list--compact {
  grid-template-columns: 140px 1fr;
  gap: 4px 14px;
  font-size: 14px;
}
.detail-list--compact dd { font-weight: 600; }
.lead-compact-line { margin: 0 0 6px; font-size: 14px; }
.lead-warn { color: #a15c00; margin: 0 0 6px; }
.lead-details { margin-top: 8px; }
.lead-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}
.mini-table--dense th,
.mini-table--dense td {
  padding: 5px 8px;
  font-size: 13px;
}
.lead-row-muted { opacity: 0.72; }
.lead-page { width: 100%; max-width: none; }
.lead-actions-card h2 { margin: 0 0 12px; }
.lead-row-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  width: max-content;
  max-width: 100%;
}
.lead-row-form select {
  flex: 0 0 auto;
  width: auto;
  min-width: 200px;
  max-width: min(100%, 360px);
}
.lead-row-form input[type="number"] { min-height: 40px; }
.lead-inline-label { font-weight: 650; color: var(--muted); }
.lead-inline-form { display: inline; margin: 0 0 0 6px; }
.lead-mini-btn {
  min-height: 28px;
  padding: 2px 8px;
  font-size: 12px;
  vertical-align: middle;
}
.lead-notes-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: start;
  margin-bottom: 10px;
  width: fit-content;
  max-width: 100%;
}
.lead-notes-form textarea {
  min-height: 64px;
  resize: vertical;
  width: min(520px, 100%);
  flex: 0 1 auto;
}
.lead-actions-card .copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}
.lead-actions-card .copy-row input {
  width: min(420px, calc(100vw - 160px));
  min-width: 180px;
  flex: 0 1 auto;
}
.timeline--compact li { padding: 8px 0; }
.lead-archive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.stack { display: grid; gap: 16px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.score { font-size: 42px; font-weight: 900; color: var(--blue-dark); }
.score-reasons { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.login-card { max-width: 440px; margin: 80px auto; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; min-width: 220px; }
.copy-row input { min-height: 40px; font-size: 13px; }
.invite-copy { margin-top: 6px; }
.invite-copy-btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 860px) {
  .hero-grid, .detail-grid { grid-template-columns: 1fr; }
  .hero-card { transform: none; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar--groups { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr; }
  .role-cards, .steps { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav { align-items: flex-start; padding: 12px 0; }
  .nav-links { justify-content: flex-end; font-size: 13px; }
  .hero { padding-top: 42px; }
  .feature-grid, .choice-grid, .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .form-card { padding: 20px; border-radius: 18px; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar--groups { grid-template-columns: 1fr; }
  .bulk-bar { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; gap: 2px; }
  .detail-list--compact { grid-template-columns: 1fr; gap: 2px; }
  .detail-list dd { margin-bottom: 10px; }
  .admin-title { align-items: flex-start; flex-direction: column; }
  .desktop-table { display: none; }
  .record-list { display: grid; }
}

.source-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.source-actions form { margin: 0; }
.modal {
  border: none;
  padding: 0;
  border-radius: 18px;
  max-width: min(640px, calc(100vw - 24px));
  width: 100%;
  background: transparent;
  margin: auto;
}
.modal[open] {
  display: block;
}
.modal::backdrop { background: rgba(15, 28, 63, 0.45); }
.modal-card {
  margin: 0;
  padding: 22px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 28, 63, 0.18);
  max-height: min(90vh, 720px);
  overflow: auto;
}

/* Social content center */
.social-status { margin-bottom: 22px; }
.social-integrations { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; }
.toolbar-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 18px; }
.social-page-meta { margin: 0 0 4px; }
.social-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin: 22px 0 8px; padding: 12px 0;
}
.social-pager-pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; flex: 1; }
.social-pager-pages a,
.social-pager-current {
  min-width: 36px; min-height: 36px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; text-align: center; text-decoration: none;
  color: inherit; display: inline-flex; align-items: center; justify-content: center;
}
.social-pager-current { background: #eef4ff; border-color: #c5d4f5; font-weight: 600; }
.social-pager .button[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.social-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.social-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: #eef2fb; }
.social-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.social-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.social-card-actions form { margin: 0; }
.social-preview { max-width: 100%; max-height: 280px; object-fit: contain; border-radius: 12px; background: #eef2fb; }
.social-preview-box { white-space: pre-wrap; word-break: break-word; background: #f7f9fd; border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-height: 120px; font: inherit; }
.social-previews { margin-top: 18px; }
.social-editor { margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.flash.success { background: #e8f8ef; color: #136f3a; }
.flash.warn { background: #fff7e6; color: #8a5a00; }
.flash.error { background: #fdeeee; color: #9b1c1c; }
.flash.info { background: #eef4ff; color: #1e429f; }
.warn-inline { color: #8a5a00; font-size: 0.92rem; }
.inline-form { display: inline; margin: 0 0 0 8px; }
.actions-cell { white-space: nowrap; }

/* Finance */
.finance-mix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 12px; }
.finance-track-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 14px; }
.finance-track-card { padding: 16px; background: #f8faff; border: 1px solid var(--border); border-radius: 14px; }
.finance-track-card h3 { margin: 0 0 4px; font-size: 16px; }
.finance-track-card__meta { margin: 0 0 14px; }
.finance-track-card__fields { grid-template-columns: 1fr; gap: 12px; }
.finance-mix-grid h3 { margin: 0 0 10px; font-size: 16px; }
.finance-summary.finance-profit--pos { border-color: #b7e4c7; background: linear-gradient(180deg, #f4fff8 0%, #fff 120px); }
.finance-summary.finance-profit--neg { border-color: #f0c4c4; background: linear-gradient(180deg, #fff8f8 0%, #fff 120px); }
.finance-net { margin: 8px 0 0; font-size: clamp(32px, 6vw, 48px); font-weight: 800; color: var(--navy); }
.finance-profit--neg .finance-net { color: var(--danger); }
.finance-profit--pos .finance-net { color: var(--success); }
.finance-table th { width: 55%; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); }
.finance-table td { text-align: right; font-weight: 700; }
.finance-table-total th, .finance-table-total td { font-size: 18px; padding-top: 16px; }
.finance-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.finance-breakdown article { padding: 14px; background: #f8faff; border-radius: 14px; border: 1px solid var(--border); }
.finance-breakdown h3 { margin: 0 0 8px; font-size: 15px; }
.finance-breakdown ul { margin: 10px 0 0; padding-left: 18px; }
.finance-formulas summary { cursor: pointer; font-weight: 700; }
.finance-formulas ul { margin: 12px 0 0; padding-left: 18px; }
.finance-collapse { padding-top: 14px; padding-bottom: 14px; }
.finance-collapse__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--navy, #0f2744);
}
.finance-collapse__summary::-webkit-details-marker { display: none; }
.finance-collapse__title::before {
  content: "▸ ";
  display: inline-block;
  transition: transform .15s ease;
}
.finance-collapse[open] > .finance-collapse__summary .finance-collapse__title::before {
  content: "▾ ";
}
.finance-collapse__summary .button { flex: 0 0 auto; }
.finance-collapse > .hint,
.finance-collapse > .finance-track-grid,
.finance-collapse > .finance-mix-grid,
.finance-collapse > .finance-discount-wrap,
.finance-collapse > .finance-expand-grid { margin-top: 12px; }
.finance-discount-table th, .finance-discount-table td { vertical-align: top; }
.finance-discount-table input { max-width: 90px; }
.finance-expand-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.badge.health-insufficient { background: #eceff4; color: #5c6578; }
.badge.health-launchable { background: #fff3c4; color: #704f00; }
.badge.health-profitable { background: #dff7e9; color: var(--success); }
.badge.health-target { background: #c8f0d8; color: #0d5c36; }

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 20px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.admin-subnav a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: var(--blue-dark);
  background: #eef3ff;
}
.admin-subnav a.is-active { background: var(--navy); color: white; }
.books-filters { margin-top: -8px; }
.books-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}
.books-quick-actions .button {
  min-height: 44px;
  padding: 0 18px;
  font-weight: 700;
}
.books-btn-income { background: #1f7a4d; border-color: #1f7a4d; }
.books-btn-income:hover, .books-btn-income.is-active { background: #17633e; border-color: #17633e; }
.books-btn-expense { background: #b42318; border-color: #b42318; }
.books-btn-expense:hover, .books-btn-expense.is-active { background: #912018; border-color: #912018; }
.books-statement-upload { display: inline-flex; margin: 0; }
.books-btn-statement {
  background: var(--navy, #1a2b4a);
  border-color: var(--navy, #1a2b4a);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.books-btn-statement:hover { filter: brightness(1.08); }
.books-delta-sync { display: inline-flex; margin: 0; }
.books-btn-delta-sync {
  background: #2f5f9e;
  border-color: #2f5f9e;
  color: #fff;
}
.books-btn-delta-sync:hover { filter: brightness(1.08); }
.books-statement-preview details summary { cursor: pointer; font-weight: 600; }
.books-statement-preview__head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.books-statement-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.books-statement-badge--preview {
  background: #fff4e5;
  color: #9a5b00;
  border: 1px solid #f0d2a0;
}
.books-statement-badge--applied {
  background: #dff7e9;
  color: #17633e;
  border: 1px solid #b7e4c7;
}
.books-statement-stage {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f6fa;
  border: 1px solid #e2e8f0;
}
.books-statement-stage--ok {
  background: #dff7e9;
  border-color: #b7e4c7;
}
.books-statement-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.books-statement-stat {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.books-statement-stat__n {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}
.books-statement-stat__l {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #5b6472;
}
.books-statement-stat--ok { border-color: #b7e4c7; background: #f3fcf6; }
.books-statement-stat--warn { border-color: #f0d2a0; background: #fff8ef; }
.books-statement-stat--info { border-color: #bfdbfe; background: #eff6ff; }
.books-statement-flash--ok {
  background: #dff7e9;
  border: 1px solid #b7e4c7;
}
.books-statement-busy {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}
.books-statement-busy[hidden] { display: none !important; }
.books-statement-busy__card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 420px;
  width: 100%;
  padding: 18px 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
}
.books-statement-busy__spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #dbe3ef;
  border-top-color: var(--navy, #1a2b4a);
  animation: books-statement-spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes books-statement-spin {
  to { transform: rotate(360deg); }
}
body.books-statement-is-busy { overflow: hidden; }
.books-income-match td { background: rgba(31, 122, 77, 0.08); }
.books-income-diff td { background: rgba(180, 35, 24, 0.08); }
.books-income-check-form { margin: 0; }
.books-income-recheck,
.books-stale {
  color: #b42318;
  font-weight: 700;
}
.books-income-recheck {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
}
.books-income-check-btn {
  min-height: 32px;
  padding: 0 8px;
  font-size: 1.1rem;
  line-height: 1;
}

.books-entry-modal {
  border: 0;
  padding: 0;
  border-radius: 16px;
  max-width: min(560px, calc(100vw - 24px));
  width: 100%;
  background: transparent;
}
.books-entry-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
}
.books-entry-modal__card {
  margin: 0;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}
.books-entry-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.books-entry-modal__head h2 {
  margin: 0;
  font-size: 22px;
}
.books-entry-modal__close {
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}
.books-entry-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.group-health-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -10px 0 18px; }

.books-month { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.books-month label { font-weight: 700; color: var(--muted); font-size: 13px; }
.books-month input { min-height: 44px; }
.books-period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 10px 0 18px;
}
.books-period-bar label {
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}
.books-period-bar input[type="date"] {
  min-height: 40px;
  max-width: 11.5rem;
}
.books-period-bar .button { min-height: 40px; }
.books-period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 18px;
}
.books-period-presets a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.books-period-presets a:hover { border-color: var(--blue-dark); color: var(--blue-dark); }
.books-period-presets a.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.books-markup-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.books-markup-filter label {
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}
.books-markup-filter select {
  min-height: 40px;
  min-width: 11rem;
  max-width: 18rem;
}
.books-markup-filter .button { min-height: 40px; }
.books-markup-cell { min-width: 12rem; vertical-align: top; }
.books-markup-edit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}
.books-markup-select {
  min-height: 34px;
  font-size: 12px;
  max-width: 14rem;
  padding: 4px 8px;
}
.books-markup-status {
  min-height: 1.1em;
  font-size: 12px;
  margin: 0;
}
.books-markup-status--ok { color: var(--success); }
.books-markup-status--err { color: var(--danger); }
.books-markup-summary {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}
.books-markup-summary th,
.books-markup-summary td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  width: auto;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.books-markup-summary thead th {
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}
.books-markup-summary__num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.books-markup-summary tbody td.books-markup-summary__num { font-weight: 700; }
.books-markup-summary--subonly th:first-child,
.books-markup-summary--subonly td:first-child { width: 55%; }
.books-markup-summary--groups th:first-child,
.books-markup-summary--groups td:first-child { width: 60%; }
.books-markup-group-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--blue-dark, #1d4f91);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  text-align: left;
}
.books-markup-group-btn:hover { color: var(--navy, #1a2b4a); }
.books-markup-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.books-collapse__summary .books-journal-export-btn {
  margin-left: auto;
  min-height: 36px;
  padding: 0 14px;
  font-weight: 600;
}
.modal--books-markup { max-width: min(820px, calc(100vw - 24px)); }
.modal--books-markup .modal-card { max-height: min(90vh, 820px); }
.books-markup-summary--lines td:nth-child(3) {
  max-width: 18rem;
  overflow-wrap: anywhere;
}
.books-markup-cell-edit {
  cursor: pointer;
  border-radius: 6px;
}
.books-markup-cell-edit:hover {
  background: #f0f5ff;
}
.books-markup-note-mark {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
}
.books-markup-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.books-markup-edit-status { min-height: 1.2em; margin: 0; }
#books-markup-note-text {
  width: 100%;
  min-height: 6rem;
  resize: vertical;
}
.books-collapse > summary.books-collapse__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  font-weight: 700;
}
.books-collapse > summary.books-collapse__summary::-webkit-details-marker { display: none; }
.books-collapse > summary.books-collapse__summary::before {
  content: '▸';
  display: inline-block;
  width: 1em;
  color: var(--muted);
}
.books-collapse[open] > summary.books-collapse__summary::before { content: '▾'; }
.books-collapse__title { font-size: 1.05rem; }
.books-collapse > :not(summary) { margin-top: 12px; }
.books-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.books-pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px; margin: 12px 0 8px; padding: 8px 0;
}
.books-pager-pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.books-pager-pages a,
.books-pager-current {
  min-width: 36px; min-height: 36px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; text-align: center; text-decoration: none;
  color: inherit; display: inline-flex; align-items: center; justify-content: center;
}
.books-pager-current { background: #eef4ff; border-color: #c5d4f5; font-weight: 600; }
.books-pager .button[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.books-pager-meta { margin: 0 0 10px; text-align: center; }
.books-account { padding: 14px 16px; background: white; border: 1px solid var(--border); border-radius: 14px; }
.books-account h3 { margin: 0 0 2px; font-size: 15px; }
.books-account .hint { margin: 0 0 8px; }
.books-account strong { display: block; font-size: 22px; }
.books-account .finance-profit--pos { color: var(--success); }
.books-account .finance-profit--neg { color: var(--danger); }
.books-period { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 4px; }
.books-llc .hint { margin: 0 0 12px; }
.books-llc .finance-table + .hint { margin: 12px 0 0; }
.books-account-closed { opacity: 0.72; }
.books-manage h3 { margin: 18px 0 10px; font-size: 16px; }
.report-account-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
}
.report-account-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}
.report-account-check .hint { display: block; font-weight: 500; }
.report-accounts-form { margin-top: 4px; }
.books-manage details { margin-top: 8px; }
.books-manage summary { cursor: pointer; font-weight: 700; color: var(--blue-dark); }
.groups-fill { min-width: 140px; }
.groups-fill .progress { margin-top: 6px; }
.groups-seats-form { margin-top: 8px; }
.groups-seats-form__label {
  display: block;
  font-size: 11px;
  color: #5a6b85;
  margin-bottom: 4px;
}
.groups-seats-form__row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.groups-seats-form__row input {
  width: 4.5rem;
  padding: 4px 6px;
  font-size: 13px;
}
.groups-table td { vertical-align: top; }
.groups-table th { vertical-align: bottom; }
.groups-view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 16px;
  margin: 0 0 14px;
}
.groups-view-toggle { display: flex; flex-wrap: wrap; gap: 8px; }
.groups-view-bar__count { margin-left: auto; }
.groups-table--brief td { vertical-align: middle; }
.groups-table--brief th { vertical-align: middle; }
.groups-table--brief .groups-fill-brief {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.group-teacher-override .choice-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}
.group-teacher-override .choice-inline input { width: auto; margin: 0; }
.teachers-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.teachers-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.teachers-tabs a.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
.th-sort:hover { text-decoration: underline; }
.th-sort.is-active { color: var(--blue, #1a3a6b); }
.th-sort__mark {
  font-size: 11px;
  opacity: 0.45;
  font-weight: 700;
}
.th-sort__mark.is-active { opacity: 1; }
.th-status-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.th-status-filter__label {
  font-size: 12px;
  font-weight: 700;
}
.th-status-filter select {
  max-width: 140px;
  font-size: 12px;
  padding: 4px 6px;
}
.groups-row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.groups-row-actions .button { min-height: 36px; }
.groups-row-actions form { margin: 0; }
.button-danger { color: #7c2727; }
.modal--group { max-width: min(760px, calc(100vw - 24px)); }
.modal--group .modal-card { max-height: min(92vh, 860px); }
.audience-presets { margin: 0; padding: 0; border: 0; }
.audience-presets legend { font-weight: 700; margin-bottom: 8px; }
.audience-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.audience-pill { display: block; margin: 0; }
.audience-pill input { position: absolute; opacity: 0; pointer-events: none; }
.audience-pill span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--blue-dark);
  font-weight: 700;
  cursor: pointer;
}
.audience-pill small { font-weight: 600; color: var(--muted); font-size: 11px; }
.audience-pill input:checked + span { background: var(--navy); color: white; }
.audience-pill input:checked + span small { color: rgba(255,255,255,.78); }
.audience-pill input:focus-visible + span { outline: 2px solid var(--blue-dark); outline-offset: 2px; }
.audience-help { margin: 8px 0 0; }
.badge.match-exact { background: #dff7e9; color: var(--success); }
.badge.match-class { background: #fff3c4; color: #704f00; }
.badge.match-age { background: #e9eeff; color: var(--blue-dark); }
.group-suggest { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.group-suggest:last-of-type { border-bottom: 0; }

@media (max-width: 1100px) {
  .admin-nav { gap: 10px; font-size: 14px; }
}
@media (max-width: 900px) {
  .admin-header .brand span { display: none; }
  .admin-header .nav { flex-wrap: wrap; }
  .admin-nav {
    width: 100%;
    flex-wrap: wrap;
    padding-bottom: 6px;
  }
  .admin-nav-menu { min-width: 160px; }
  .admin-books-quick {
    position: sticky;
    top: 0;
  }
  .admin-books-quick__inner {
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .admin-books-quick .button {
    flex: 1 1 0;
    min-height: 48px;
    font-size: 16px;
  }
  .finance-mix-grid { grid-template-columns: 1fr; }
  .finance-track-grid { grid-template-columns: 1fr; }
  .finance-table th, .finance-table td { display: block; width: 100%; text-align: left; }
  .finance-table td { padding-top: 0; padding-bottom: 12px; }
  .group-health-legend { flex-direction: column; align-items: flex-start; }
}

/* CRM Documents */
.crm-docs-list {
  display: grid;
  gap: 14px;
}
.crm-docs-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 20px 22px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.crm-docs-item:hover {
  border-color: #b8c6ef;
  box-shadow: 0 8px 24px rgba(36, 58, 120, 0.08);
}
.crm-docs-item__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.crm-docs-item__title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--blue-dark);
}
.crm-docs-item__title a {
  color: inherit;
  text-decoration: none;
}
.crm-docs-item__title a:hover { text-decoration: underline; }
.crm-docs-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.crm-docs-pdf-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}
.crm-docs-audience-form,
.crm-docs-publish-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.crm-docs-audience-select {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #e9eeff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.crm-docs-audience-select.is-super {
  background: #f4e6e6;
  color: #7c2727;
}
.crm-docs-audience-select.is-editing {
  background: #fff3c4;
  color: #704f00;
}
.crm-docs-item__excerpt {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.crm-docs-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.crm-doc-body {
  color: #1f2a44;
  font-size: 16px;
  line-height: 1.55;
}
.crm-doc-body > *:first-child { margin-top: 0; }
.crm-doc-body > *:last-child { margin-bottom: 0; }
.crm-doc-body h2,
.crm-doc-body h3,
.crm-doc-body h4 {
  color: var(--blue-dark);
  margin: 1.4em 0 0.55em;
  line-height: 1.25;
}
.crm-doc-body h2 { font-size: 1.35rem; }
.crm-doc-body h3 { font-size: 1.15rem; }
.crm-doc-body p { margin: 0 0 0.9em; color: inherit; }
.crm-doc-body ul,
.crm-doc-body ol { margin: 0 0 1em; padding-left: 1.35em; }
.crm-doc-body li { margin: 0.25em 0; }
.crm-doc-body a { font-weight: 700; }
.crm-doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.1em;
  font-size: 14px;
}
.crm-doc-body th,
.crm-doc-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.crm-doc-body th {
  background: #f3f6ff;
  color: var(--blue-dark);
  font-weight: 800;
}
.crm-doc-body blockquote {
  margin: 0 0 1em;
  padding: 10px 14px;
  border-left: 3px solid #b8c6ef;
  background: #f7f9ff;
  color: #3d4a63;
}
.crm-doc-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.4em 0;
}
.crm-doc-body .crm-doc-blank {
  margin: 0;
}
.crm-doc.is-editing {
  border-color: #8ea4e8;
  box-shadow: 0 0 0 3px rgba(64, 98, 196, 0.12);
}
.crm-doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin: -8px 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.crm-doc-toolbar__formats,
.crm-doc-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.crm-doc-toolbar .ghost {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
}
.crm-doc-body[contenteditable="true"] {
  outline: none;
  min-height: 240px;
  border-radius: 12px;
  padding: 4px;
}
.crm-doc-body[contenteditable="true"]:focus {
  background: #fbfcff;
}
.notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #dff7e9;
  border: 1px solid #b7e4c7;
  color: #0d5c36;
  font-weight: 700;
}
@media (max-width: 620px) {
  .crm-doc-body { overflow-x: auto; }
  .crm-doc-body table { min-width: 520px; }
  .crm-doc-toolbar { flex-direction: column; align-items: stretch; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.col-discount { min-width: 92px; }
.lead-discount-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.lead-discount-edit--card { display: inline-flex; }
.lead-discount-input {
  width: 4.2rem;
  min-height: 36px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  background: #fff;
}
.lead-discount-input:focus {
  outline: 2px solid #8ea4e8;
  outline-offset: 1px;
  border-color: #8ea4e8;
}
.lead-discount-input.is-saving {
  border-color: #c9a227;
  background: #fff8e5;
}
.lead-discount-input.is-saved {
  border-color: #7bc89a;
  background: #dff7e9;
}
.lead-discount-input.is-error {
  border-color: #c97a7a;
  background: #fbeeee;
}
.lead-discount-input.is-applied {
  box-shadow: inset 0 0 0 1px #7bc89a;
}
.lead-discount-suffix {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.lead-discount-ok {
  margin-left: 2px;
}

/* Lead Delta sync modal */
.lead-sync-modal { gap: 12px; }
.lead-sync-modal__text { margin: 0; }
.lead-sync-modal__result {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  line-height: 1.45;
  background: #f7f9fd;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.lead-sync-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.lead-sync-anim {
  display: flex;
  justify-content: center;
  margin: 4px 0 8px;
}
.lead-sync-robot {
  position: relative;
  width: 72px;
  height: 78px;
  animation: lead-sync-bounce 1.1s ease-in-out infinite;
}
.lead-sync-robot__antenna {
  position: absolute;
  left: 34px;
  top: 0;
  width: 4px;
  height: 12px;
  background: #3d5a9a;
  border-radius: 2px;
}
.lead-sync-robot__antenna::after {
  content: '';
  position: absolute;
  left: -3px;
  top: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e8a317;
  animation: lead-sync-blink 0.9s ease-in-out infinite;
}
.lead-sync-robot__head {
  position: absolute;
  left: 16px;
  top: 12px;
  width: 40px;
  height: 28px;
  border-radius: 10px 10px 8px 8px;
  background: #5b7cc9;
}
.lead-sync-robot__eye {
  position: absolute;
  top: 22px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: lead-sync-blink 1.4s step-end infinite;
}
.lead-sync-robot__eye--l { left: 24px; }
.lead-sync-robot__eye--r { left: 41px; }
.lead-sync-robot__body {
  position: absolute;
  left: 12px;
  top: 42px;
  width: 48px;
  height: 30px;
  border-radius: 8px;
  background: #3f66b8;
}
.lead-sync-robot__gear {
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border: 3px solid #c9a227;
  border-radius: 50%;
  box-sizing: border-box;
  animation: lead-sync-spin 1.2s linear infinite;
}
.lead-sync-robot__gear::before,
.lead-sync-robot__gear::after {
  content: '';
  position: absolute;
  background: #c9a227;
}
.lead-sync-robot__gear::before {
  left: 6px;
  top: -3px;
  width: 3px;
  height: 18px;
}
.lead-sync-robot__gear::after {
  left: -3px;
  top: 6px;
  width: 18px;
  height: 3px;
}
@keyframes lead-sync-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes lead-sync-spin {
  to { transform: rotate(360deg); }
}
@keyframes lead-sync-blink {
  0%, 45%, 55%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}
[data-sync-result-title][data-kind="error"] { color: #a33; }
[data-sync-result-title][data-kind="partial"] { color: #9a6b00; }
[data-sync-result-title][data-kind="ok"] { color: #2a7a4b; }
[data-sync-result-title][data-kind="cancelled"] { color: var(--muted); }

/* Admin lesson schedule (week grid) */
.schedule-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
}
.schedule-toolbar__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.schedule-toolbar__range { margin: 0; }
.schedule-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
}
.schedule-filters label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted, #5a6578);
}
.schedule-filters select {
  min-width: 12rem;
  min-height: 40px;
}
.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  color: var(--muted, #5a6578);
}
.schedule-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.schedule-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.schedule-dot--conducted { background: #2f9e6a; }
.schedule-dot--incomplete { background: #d4a017; }
.schedule-dot--planned { background: #4d7ec8; }
.schedule-dot--cancelled { background: #c44b4b; }

.schedule-week {
  display: none;
  gap: 0;
  position: relative;
  margin-bottom: 24px;
  overflow-x: auto;
}
@media (min-width: 960px) {
  .schedule-week { display: grid; grid-template-columns: 48px 1fr; }
  .schedule-mobile { display: none; }
}
.schedule-week__hours {
  position: relative;
  min-height: 640px;
  font-size: 0.75rem;
  color: var(--muted, #5a6578);
}
.schedule-week__hour {
  position: absolute;
  left: 0;
  transform: translateY(-50%);
}
.schedule-week__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 4px;
  min-height: 640px;
}
.schedule-day {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(26, 43, 74, 0.12);
  border-radius: 10px;
  background: #fafbfd;
  min-height: 640px;
  overflow: hidden;
}
.schedule-day.is-today {
  border-color: rgba(47, 158, 106, 0.45);
  background: #f3faf6;
}
.schedule-day__head {
  padding: 8px 8px 6px;
  border-bottom: 1px solid rgba(26, 43, 74, 0.08);
}
.schedule-day__head h2 {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.25;
}
.schedule-day__grid {
  position: relative;
  flex: 1;
  min-height: 560px;
}
.schedule-card {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 8px;
  text-decoration: none;
  color: #132033;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.schedule-card:hover { filter: brightness(0.97); }
.schedule-card__topic {
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-card__time { font-weight: 600; }
.schedule-card__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}
.schedule-card--conducted { background: #d8f3e6; border-left: 3px solid #2f9e6a; }
.schedule-card--conducted_incomplete { background: #fff0c9; border-left: 3px solid #d4a017; }
.schedule-card--planned { background: #dce8fb; border-left: 3px solid #4d7ec8; }
.schedule-card--cancelled { background: #f8dede; border-left: 3px solid #c44b4b; opacity: 0.85; }

.schedule-mobile { display: grid; gap: 8px; padding: 12px 14px; }
.schedule-mobile__day summary {
  cursor: pointer;
  font-weight: 700;
  padding: 8px 0;
}
.schedule-mobile__day.is-today summary { color: #2a7a4b; }
.schedule-mobile__list {
  list-style: none;
  margin: 0;
  padding: 0 0 10px;
  display: grid;
  gap: 8px;
}
.schedule-card--list {
  position: static;
  height: auto !important;
  padding: 10px 12px;
}
