:root {
  --bg0: #0f3d38;
  --bg1: #165a52;
  --green: #1a5c54;
  --green-deep: #0d3a35;
  --accent: #e6d3b0;
  --accent-strong: #d9c19a;
  --accent2: #f3e6d0;
  --page: #f3f1ec;
  --card: #ffffff;
  --text: #1d2a28;
  --muted: #6b7874;
  --line: #e4e0d8;
  --danger: #b42318;
  --ok: #0f7a4c;
  --shadow: 0 10px 28px rgba(22, 40, 36, 0.08);
  --radius: 14px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--page);
}

a { color: var(--green); }
.wrap {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

/* Cabinet shell */
body.cabinet-body {
  background: #e8ebe8;
}
.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
  background: var(--page);
  box-shadow: var(--shadow);
}
.sidebar {
  background: #06312a;
  border-right: 0;
  color: #f4fff9;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__brand a {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.22rem;
  color: #f4fff9;
  text-decoration: none;
}
.sidebar__brand-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
}
.sidebar__brand-accent {
  color: #e7c86a;
}
.sidebar__divider {
  height: 1px;
  margin: 2px 8px 0;
  background: rgba(255, 255, 255, 0.12);
}
.sidebar__section-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(190, 210, 205, 0.55);
  margin: 0 8px 10px;
  font-weight: 600;
}
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
.sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 14px 12px 16px;
  border-radius: 0 12px 12px 0;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease;
}
.sidebar__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: rgba(255,255,255,0.92);
}
.sidebar__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.sidebar__label {
  min-width: 0;
}
.sidebar__link:hover {
  background: rgba(214, 196, 150, 0.14);
}
.sidebar__link:hover .sidebar__icon {
  color: #e7c86a;
}
.sidebar__link.is-active {
  background: rgba(214, 196, 150, 0.18);
  color: #fff;
  font-weight: 600;
}
.sidebar__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0;
  background: #e7c86a;
}
.sidebar__link.is-active .sidebar__icon {
  color: #e7c86a;
}
.sidebar__foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}
.sidebar__foot .sidebar__link {
  color: rgba(255,255,255,0.8);
}
.app-main {
  min-width: 0;
  background: var(--page);
  padding: 24px 24px 40px;
}
.app-main__inner {
  width: 100%;
  max-width: none;
  margin: 0;
}

.cab-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.cab-topbar__user {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.cab-topbar__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 auto;
  border: 2px solid var(--accent);
}
.cab-topbar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cab-topbar__hello {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.cab-topbar__meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}
.cab-topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cab-topbar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}
.cab-topbar__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.cab-action {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #4b5a56;
  min-width: 92px;
  padding: 4px;
  font: inherit;
}
.cab-action:hover {
  color: var(--green);
}
.cab-action__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}
.cab-action__icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.cab-action__label {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .cab-topbar { align-items: flex-start; }
  .cab-topbar__actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  color: #f4fff9;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
}
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; }
.topbar a {
  color: #eaf7f2;
  text-decoration: none;
  font-size: 0.92rem;
  opacity: 0.9;
}
.topbar a:hover { opacity: 1; text-decoration: underline; }
.topbar a.is-active {
  opacity: 1;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.branch-create {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.branch-create__fields {
  flex: 1;
  min-width: 220px;
}
.branch-create__fields > label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.branch-create__row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.branch-create__row .form-control {
  flex: 1;
  min-width: 180px;
}
.branch-create__hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.branch-list {
  display: grid;
  gap: 12px;
}
.branch-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.branch-card.is-off { opacity: 0.72; }
.branch-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.branch-card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.branch-meta {
  color: var(--muted);
  font-size: 0.86rem;
}
.branch-link-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}
.btn-danger-outline {
  background: transparent;
  border: 1px solid #e2a8a4;
  color: #b42318;
}
.btn-danger-outline:hover {
  background: #fef3f2;
  filter: none;
}
@media (max-width: 720px) {
  .branch-link-row { grid-template-columns: 1fr; }
  .branch-create__row { flex-direction: column; align-items: stretch; }
  .branch-create__row .btn { width: 100%; }
}
.btn-sm {
  width: auto;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 0;
  border-bottom: 0;
}
.tabs__btn {
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
}
.tabs__btn:hover {
  background: var(--accent2);
  color: var(--text);
}
.tabs__btn.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.tab-panel[hidden] { display: none !important; }
.tab-panel.is-active { display: block; }

.viz-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.zoom-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
}
.zoom-btn {
  border: 0;
  background: var(--green);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.zoom-btn--pct {
  width: auto;
  min-width: 64px;
  padding: 0 12px;
  font-size: 0.9rem;
  background: var(--accent);
  color: #2a2418;
}
.zoom-btn:hover { filter: brightness(1.08); }

.viz-viewport {
  height: min(68vh, 640px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(42, 157, 143, 0.08), transparent 55%),
    #eef3f2;
  overflow: hidden;
  position: relative;
  cursor: grab;
}
.viz-viewport.is-dragging { cursor: grabbing; }
.viz-stage {
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;
}
.tree-view {
  position: relative;
  width: 1600px;
  height: 1100px;
  left: 50%;
  top: 50%;
  margin-left: -800px;
  margin-top: -550px;
}
.tree-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.tree-svg line {
  stroke-width: 3;
  stroke-linecap: round;
}
.viz-node {
  position: absolute;
  width: 92px;
  height: 92px;
  margin-left: -46px;
  margin-top: -46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
  box-sizing: border-box;
  background: #fff;
  border: 3px solid #2a9d8f;
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  z-index: 2;
}
.viz-node.is-root {
  width: 108px;
  height: 108px;
  margin-left: -54px;
  margin-top: -54px;
  background: var(--green);
  border: 3px solid var(--accent);
  color: #fff;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  z-index: 3;
  overflow: hidden;
  padding: 0;
}
.viz-node.is-root img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.viz-node-wrap {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
}
.viz-node-wrap .viz-node {
  position: relative;
  left: auto !important;
  top: auto !important;
  margin: 0 auto !important;
}
.viz-node-id {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.viz-node__name {
  max-width: 78px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.viz-node.is-branch {
  display: none;
}
.viz-sector-label {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
  pointer-events: none;
  z-index: 1;
  background: rgba(255,255,255,0.72);
  border-radius: 999px;
  padding: 4px 10px;
}
.viz-branch-badges {
  position: absolute;
  left: 50%;
  bottom: 36px;
  top: auto;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  z-index: 4;
  max-width: 90%;
}
.viz-branch-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.viz-branch-badge {
  display: none;
}
.viz-branch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.tree-empty {
  color: var(--muted);
  text-align: center;
  padding: 24px 8px;
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.promo, .card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.promo {
  padding: 28px 26px 30px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.98), rgba(255,248,235,0.95));
}
.promo .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg1);
  font-weight: 700;
  margin-bottom: 10px;
}
.promo h1 {
  font-family: var(--display);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 12px;
}
.promo .lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.02rem;
}
.gift {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
}
.gift strong { color: var(--bg0); }
.gift ol {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.gift li { margin: 6px 0; }

.card { padding: 24px 22px 26px; }
.card h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 0 0 6px;
}
.card .sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

/* —— Registration page (reg.png layout) —— */
body.reg-page {
  --reg-green: #26463f;
  --reg-green-soft: #2f554c;
  --reg-beige: #e5c297;
  --reg-beige-hover: #dcb584;
  --reg-ink: #1c2422;
  --reg-muted: #6d7572;
  --reg-line: #e6e2db;
  --reg-serif: "Cormorant Garamond", Georgia, serif;
  min-height: 100vh;
  color: var(--reg-ink);
  background: #f4f0ea;
  position: relative;
  overflow-x: hidden;
}
.reg-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: start;
  padding: 28px 0 48px;
}
.reg-promo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 8px 8px 4px;
  animation: regFadeUp .55s ease both;
}
.reg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.reg-brand__mark {
  width: 18px;
  height: 18px;
  background: var(--reg-green);
  transform: rotate(45deg);
  border-radius: 3px;
  box-shadow: 0 0 0 3px rgba(38, 70, 63, 0.12);
}
.reg-brand__text {
  font-family: Manrope, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--reg-ink);
}
.reg-brand__text em {
  font-style: normal;
  color: #c4a46a;
}
.reg-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--reg-muted);
}
.reg-title {
  margin: 0;
  font-family: var(--reg-serif);
  font-weight: 700;
  font-size: clamp(2.1rem, 4vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--reg-ink);
}
.reg-lead {
  margin: 0 0 6px;
  color: var(--reg-muted);
  font-size: 1.02rem;
  line-height: 1.45;
  max-width: 34ch;
}
.reg-gift {
  background: var(--reg-green);
  color: #f4f7f5;
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 16px 36px rgba(38, 70, 63, 0.22);
}
.reg-gift__title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
}
.reg-gift__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.reg-gift__steps li {
  display: grid;
  grid-template-columns: 28px 28px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.92rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}
.reg-gift__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 700;
  font-size: 0.82rem;
}
.reg-gift__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #e5c297;
}
.reg-gift__icon svg {
  width: 18px;
  height: 18px;
}
.reg-perks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.reg-perk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #3f4845;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(230, 226, 219, 0.85);
  border-radius: 999px;
  padding: 8px 10px;
}
.reg-perk__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(38, 70, 63, 0.08);
  color: var(--reg-green);
  font-size: 0.72rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.reg-perk__icon svg { width: 13px; height: 13px; }
.reg-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(40, 36, 28, 0.12);
  padding: 28px 26px 22px;
  backdrop-filter: blur(6px);
  animation: regFadeUp .65s .08s ease both;
}
@keyframes regFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.reg-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(244, 240, 234, 0.18) 0%, rgba(244, 240, 234, 0.55) 48%, rgba(244, 240, 234, 0.78) 100%),
    url("/assets/img/reg.png") left center / cover no-repeat;
  animation: regBgIn .9s ease both;
}
@keyframes regBgIn {
  from { opacity: 0.65; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}
.reg-card__head h2 {
  margin: 0 0 8px;
  font-family: var(--reg-serif);
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--reg-ink);
}
.reg-card__head p {
  margin: 0 0 18px;
  color: var(--reg-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.reg-page .form-group { margin-bottom: 12px; }
.reg-page .form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #2d3533;
}
.reg-field {
  position: relative;
}
.reg-field__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #8a918e;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.reg-field__icon svg { width: 18px; height: 18px; }
.reg-page .form-control {
  width: 100%;
  border: 1px solid var(--reg-line);
  border-radius: 12px;
  padding: 12px 14px 12px 44px;
  font: inherit;
  background: #fff;
  color: var(--reg-ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.reg-page .form-control:focus {
  border-color: #c9b08a;
  box-shadow: 0 0 0 3px rgba(229, 194, 151, 0.28);
  background: #fff;
}
.reg-page select.form-control {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #7a827f 50%),
    linear-gradient(135deg, #7a827f 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.reg-page .hint {
  font-size: 0.8rem;
  color: var(--reg-muted);
  margin-top: 7px;
}
.reg-submit {
  margin-top: 6px;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
}
.reg-page .btn-accent {
  background: var(--reg-beige);
  color: #2a2418;
}
.reg-page .btn-accent:hover {
  background: var(--reg-beige-hover);
}
.reg-page .btn-primary {
  background: var(--reg-green);
  color: #fff;
}
.reg-legal {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.reg-legal p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--reg-muted);
}
.reg-legal strong {
  color: #3f4845;
  font-weight: 700;
}
.reg-legal a {
  color: var(--reg-green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.reg-legal a:hover {
  color: var(--reg-green-soft);
}
.reg-card__links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--reg-line);
}
.reg-card__links a {
  color: var(--reg-green);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}
.reg-card__links a:hover { text-decoration: underline; }

@media (max-width: 980px) {
  .reg-shell {
    grid-template-columns: 1fr;
    width: min(560px, calc(100% - 28px));
    align-items: stretch;
    padding: 24px 0 36px;
  }
  .reg-bg {
    background:
      linear-gradient(180deg, rgba(244, 240, 234, 0.55) 0%, rgba(244, 240, 234, 0.88) 42%, rgba(244, 240, 234, 0.96) 100%),
      url("/assets/img/reg.png") left top / cover no-repeat;
  }
  .reg-perks { grid-template-columns: 1fr; }
  .reg-perk { border-radius: 12px; }
  .reg-lead { max-width: none; }
}
@media (max-width: 520px) {
  .reg-card { padding: 22px 16px 18px; }
  .reg-gift__steps li {
    grid-template-columns: 26px 1fr;
  }
  .reg-gift__icon { display: none; }
}

.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #f7f5f1;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: #b9a57d;
  box-shadow: 0 0 0 3px rgba(217, 193, 154, 0.28);
  background: #fff;
}
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-accent {
  background: var(--accent);
  color: #2a2418;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent-strong);
  color: #7a6845;
}
.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}
.error {
  display: none;
  background: #fef3f2;
  color: var(--danger);
  border: 1px solid #f5c2c0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.error.show { display: block; }
.success-box {
  display: none;
  background: #ecfdf3;
  border: 1px solid #abe2c3;
  color: var(--ok);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.success-box.show { display: block; }
#step2 { display: none; }
.legal {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}
.footer {
  margin-top: 26px;
  color: rgba(255,255,255,0.78);
  font-size: 0.82rem;
  text-align: center;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.login-card h1 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0 0 8px;
  text-align: center;
}
.login-card .sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 0.92rem;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.88rem;
}
.cabinet {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.cabinet h1 {
  font-family: var(--display);
  margin: 0 0 8px;
  font-size: 1.35rem;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr; }
}
.stat-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
}
.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: rgba(26, 92, 84, 0.1);
  color: var(--green);
}
.stat-card__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}
.stat-card__body {
  min-width: 0;
  flex: 1;
}
.stat-card__label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}
.stat-card__value {
  margin-top: 4px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.1;
}
.stat-card__meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stat-card__trend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.stat-card__trend.is-up {
  color: #1a7a4c;
}
.stat-card__spark {
  width: 88px;
  height: 28px;
  flex: 0 0 auto;
  display: block;
}
.bb-sync {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.bb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 720px) {
  .bb-grid { grid-template-columns: 1fr; }
}
.bb-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}
.bb-card__label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.bb-card__value {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 26, 0.45);
}
.modal__card {
  position: relative;
  width: min(460px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  padding: 20px;
}
.modal__card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.form-hint-error {
  display: none;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}
.form-hint-error.show { display: block; }
.panel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.panel-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-card__head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.meta .item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}
.meta .item span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}
.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8eb;
  border: 1px solid #f0d7a4;
  color: #6a4b12;
  font-size: 0.9rem;
}

/* Settings */
.settings-head h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 800;
}
.settings-head__sub {
  margin: 0 0 18px;
  color: var(--muted);
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) {
  .settings-layout { grid-template-columns: 1fr; }
}
.settings-main {
  display: grid;
  gap: 14px;
}
.settings-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}
@media (max-width: 720px) {
  .settings-row { grid-template-columns: 1fr; }
}
.settings-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.settings-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.settings-card__desc {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}
.settings-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding-top: 8px;
}
.settings-photo__avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.6rem;
  border: 3px solid var(--accent);
}
.settings-photo__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.settings-photo__btn {
  width: auto;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
}
.settings-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.settings-status {
  resize: vertical;
  min-height: 110px;
  background: #f7f5f1;
}
.settings-counter {
  margin-top: 8px;
  text-align: right;
  color: var(--muted);
  font-size: 0.8rem;
}
.messenger-row,
.email-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
@media (max-width: 720px) {
  .messenger-row,
  .email-row {
    grid-template-columns: 1fr;
  }
}
.messenger-row__brand,
.email-row__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.messenger-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
}
.messenger-ico--tg { background: #2aabee; }
.messenger-ico--wa { background: #25d366; }
.messenger-ico--max { background: #5b4bdb; }
.messenger-ico--mail { background: var(--green); }
.messenger-vis {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}
.email-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f0eeea;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.email-badge.is-ok {
  background: #e7f6ee;
  color: #0f7a4c;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.settings-secure {
  color: var(--muted);
  font-size: 0.84rem;
}
.settings-side {
  position: sticky;
  top: 20px;
}
.settings-info {
  background: #f7f3ea;
  border: 1px solid #e8dcc6;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(40, 32, 18, 0.06);
  padding: 18px 16px 16px;
}
.settings-info__title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1d2a28;
}
.settings-info__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.settings-info__list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  color: #3f463f;
  font-size: 0.88rem;
  line-height: 1.4;
}
.settings-info__ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #b89a5d;
  flex: 0 0 auto;
}
.settings-info__ico svg {
  width: 22px;
  height: 22px;
  display: block;
}
.settings-info__divider {
  height: 1px;
  margin: 16px 0;
  background: rgba(120, 100, 60, 0.18);
}
.settings-info__tip {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}
.settings-info__tip-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #1d2a28;
  margin-bottom: 4px;
}
.settings-info__tip p {
  margin: 0;
  color: #3f463f;
  font-size: 0.88rem;
  line-height: 1.4;
}

.school-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  min-height: 280px;
}
.school-empty__icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(145deg, #e8f5e9, #f1f8e9);
  color: #2e7d32;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}
.school-empty__icon svg {
  width: 36px;
  height: 36px;
}
.school-empty h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1d2a28;
}
.school-empty p {
  margin: 0;
  max-width: 360px;
  color: #5a655c;
  font-size: 0.95rem;
  line-height: 1.5;
}

.school-courses .school-course {
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  overflow: hidden;
  min-width: 0;
}
.school-courses .school-course:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #c9d9cf;
}
.school-courses .school-course.is-active {
  border-color: #1a5c54;
  box-shadow: 0 0 0 1px rgba(26, 92, 84, 0.18), var(--shadow);
}
.school-courses .school-course.is-locked,
.school-courses .school-course:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}
.school-courses .stat-card__body {
  overflow: hidden;
  min-width: 0;
}
.school-courses .stat-card__meta {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.school-courses .stat-card__trend {
  white-space: normal;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
}
.school-courses .stat-card__spark {
  width: 72px;
  max-width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
}
.school-course__name {
  font-size: 1.15rem !important;
  margin-top: 2px !important;
  overflow-wrap: anywhere;
  line-height: 1.25 !important;
}
.school-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.school-head__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}
.school-head__points {
  margin: 0;
  text-align: right;
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .school-head__row {
    align-items: flex-start;
  }
  .school-head__points {
    width: 100%;
    text-align: left;
  }
  .school-head__hint {
    display: block;
  }
}
.school-courses[hidden],
.school-panel[hidden],
.school-back[hidden] {
  display: none !important;
}
.school-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #1d2a28;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}
.school-back svg {
  width: 18px;
  height: 18px;
}
.school-back:hover {
  border-color: #c9d9cf;
  background: #f7faf8;
}
.school-lessons {
  display: grid;
  gap: 8px;
}
.school-server-form {
  margin-top: 14px;
  max-width: 420px;
  display: grid;
  gap: 10px;
}
.school-server-form .field {
  margin: 0;
}
.school-server-form .field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #3f463f;
}
.school-server-form .form-control {
  padding: 8px 11px;
  font-size: 0.84rem;
  border-radius: 10px;
}
.school-server-form .btn {
  font-size: 0.84rem;
  padding: 9px 14px;
  min-height: 0;
}
.school-server-form .error,
.school-server-form .success-box {
  font-size: 0.82rem;
  padding: 8px 10px;
  margin-bottom: 0;
}
#school-panel-server .panel-card__head h2 {
  font-size: 0.98rem;
}
#school-panel-server .school-soon {
  font-size: 0.8rem;
  line-height: 1.4;
  padding-bottom: 4px;
}
.school-complete-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.school-complete-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.school-complete-note {
  margin: 14px 0 0;
  color: #2e7d32;
  font-weight: 600;
  font-size: 0.95rem;
}
.school-soon {
  margin: 0;
  padding: 4px 2px 8px;
  color: var(--muted);
  font-size: 0.92rem;
}
.school-lesson {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  overflow: hidden;
}
.school-lesson.is-open {
  background: #fff;
  border-color: #c9d9cf;
}
.school-lesson__btn {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.school-lesson__play {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1a5c54;
  color: #fff;
  font-size: 0.7rem;
  margin-top: 1px;
}
.school-lesson__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.school-lesson__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1d2a28;
  line-height: 1.35;
}
.school-lesson__dur {
  font-size: 0.8rem;
  color: var(--muted);
}
.school-lesson__player {
  padding: 0 14px 14px;
}
.school-lesson__player video {
  width: 100%;
  max-height: 420px;
  border-radius: 10px;
  background: #111;
  display: block;
}
