/* RedPaper Plane admin — visual theme aligned with the Telegram miniapp */

:root {
  --lb-bg: #a8d4f0;
  --lb-sky: #a8d4f0;
  --lb-sky-deep: #2d74fe;
  --lb-accent: #2d74fe;
  --lb-accent-hover: #1a5fe8;
  --lb-accent-muted-bg: #eff6ff;
  --lb-blue: #3b82f6;
  --lb-blue-dark: #2563eb;
  --lb-blue-light: #60a5fa;
  --lb-blue-soft: #eff6ff;
  --lb-border: #e2e8f0;
  --lb-border-soft: #f1f5f9;
  --lb-content-inset: 14px;
  --lb-radius: 16px;
  --lb-btn-radius: 12px;
  --lb-topnav-h: 3.25rem;
  --lb-hero-gradient: linear-gradient(
    180deg,
    rgba(45, 116, 254, 0.72) 0%,
    rgba(90, 160, 245, 0.55) 26%,
    rgba(168, 212, 240, 0.45) 52%,
    rgba(168, 212, 240, 0.15) 72%,
    transparent 88%
  );
}

body.lb-body {
  font: 14px/1.5 "Inter", system-ui, -apple-system, sans-serif;
  color: var(--lb-text);
  background-color: var(--lb-sky);
  background-image: var(--lb-hero-gradient), url("/static/img/hero-bg.png?v=20260721c");
  background-repeat: no-repeat, no-repeat;
  background-position: top center, top center;
  background-size: 100% 420px, 100% auto;
  background-attachment: scroll;
  -webkit-font-smoothing: antialiased;
}

.lb-layout {
  min-height: 100vh;
  padding-top: var(--lb-topnav-h);
}

/* ——— Top bar (compact, fixed) ——— */
.lb-topnav {
  background: var(--lb-sky-deep);
  border-bottom: none;
  padding: 0 1.25rem;
  height: var(--lb-topnav-h);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-sizing: border-box;
}

.lb-logo {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1;
}

.lb-logo-img {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: none;
  flex-shrink: 0;
}

.lb-logo-icon {
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.55);
  color: #fff;
}

.lb-tenant-label {
  color: rgba(255, 255, 255, 0.78);
}

.lb-tenant-select {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lb-tenant-select:focus {
  border-color: rgba(255, 255, 255, 0.85);
  outline: none;
}

.lb-tenant-select option {
  color: var(--lb-text);
  background: #fff;
}

.lb-lang--topnav {
  gap: 0.2rem;
  padding: 0.15rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lb-lang-btn--topnav {
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  border-color: transparent;
  min-width: 2rem;
  padding: 0.25rem 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.lb-lang-btn--topnav:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border-color: transparent;
}

.lb-lang-btn--topnav.is-active {
  color: var(--lb-sky-deep, #0b3a66);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.lb-settings-btn,
.lb-btn-logout {
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 2rem;
  height: 2rem;
  padding: 0;
}

.lb-settings-btn:hover,
.lb-btn-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.75);
}

.lb-settings-btn.is-active {
  color: var(--lb-sky-deep);
  background: #fff;
  border-color: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}

/* ——— Main content panel (full-bleed white sheet) ——— */
.lb-main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lb-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--lb-topnav-h);
}

.lb-settings,
.lb-settings--full {
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 32px rgba(15, 23, 42, 0.08);
  border: none;
  padding: 1.5rem 1.75rem 2.5rem;
  gap: 1.5rem 1.75rem;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: calc(100vh - var(--lb-topnav-h));
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  align-items: start;
}

.lb-settings--full {
  grid-template-columns: none;
}

.lb-settings-nav {
  position: sticky;
  top: calc(var(--lb-topnav-h) + 0.75rem);
  width: 12.5rem;
}

.lb-settings-menu {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}

.lb-settings-content {
  min-width: 0;
  width: 100%;
}

.lb-funnel-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lb-funnel-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1.5px solid #5aa0f5;
  background: #fff;
}

.lb-funnel-pill__n {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--lb-sky-deep, #0b3a66);
}

.lb-funnel-pill__l {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lb-muted);
}


.lb-settings-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1.5rem;
}

.lb-settings-jump__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--lb-sky-deep);
  background: #fff;
  border: 1px solid rgba(45, 116, 254, 0.2);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.lb-settings-jump__link:hover {
  background: #f8fbff;
  border-color: rgba(45, 116, 254, 0.4);
}

.lb-settings-jump__link--alert {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.35);
  background: #fef2f2;
}

.lb-settings-section {
  scroll-margin-top: calc(var(--lb-topnav-h) + 0.75rem);
  padding: 0 0 2rem;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid var(--lb-border-soft);
}

.lb-settings-section--last {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0.5rem;
}

/* Operator / dashboard pages without settings chrome */
.lb-main:not(:has(> .lb-settings)):not(:has(> .lb-settings--full)) {
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 32px rgba(15, 23, 42, 0.08);
  padding: 1.5rem 1.75rem 2.5rem;
  min-height: calc(100vh - var(--lb-topnav-h));
  box-sizing: border-box;
}

/* Pages without settings chrome: lift direct cards into a sheet feel */
.lb-main > .lb-card,
.lb-main > .lb-page-head,
.lb-main > form.lb-card {
  border-radius: var(--lb-radius);
}

/* ——— Sidebar menu (stacked) ——— */
.lb-settings-nav {
  position: sticky;
  top: calc(var(--lb-topnav-h) + 0.75rem);
  width: 12.5rem;
}

.lb-settings-menu {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}

.lb-settings-link {
  display: block;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--lb-sky-deep, #0b3a66);
  text-decoration: none;
  border-radius: 14px;
  border: 1.5px solid #5aa0f5;
  outline: none;
  background: #fff;
  text-shadow: none;
  box-shadow: none;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lb-settings-link:hover {
  color: var(--lb-sky-deep, #0b3a66);
  background: #f8fbff;
  border-color: #2d74fe;
}

.lb-settings-link.is-active,
.lb-settings-link.is-active:hover {
  color: #fff;
  background: #5aa0f5;
  border: 1.5px solid #5aa0f5;
  outline: none;
  box-shadow: none;
  text-shadow: none;
  font-weight: 700;
}

.lb-settings-link:focus,
.lb-settings-link:focus-visible {
  outline: none;
}

.lb-settings-link--alert {
  border: 1.5px solid #f87171;
  background: #fff;
  color: #991b1b;
  text-shadow: none;
  box-shadow: none;
}

/* ——— Page chrome ——— */
.lb-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--lb-text);
  letter-spacing: -0.02em;
}

.lb-page-lead,
.lb-hint {
  color: var(--lb-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.lb-link {
  color: var(--lb-sky-deep);
  font-weight: 600;
}

.lb-link:hover {
  color: var(--lb-accent-hover);
}

/* ——— Cards & panels ——— */
.lb-card {
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.05);
  background: #fff;
}

.lb-accordion,
.lb-accordion--panel {
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.lb-accordion > summary.lb-accordion__summary {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--lb-text);
  background: #fff;
  border-bottom: 1px solid transparent;
}

.lb-accordion[open] > summary.lb-accordion__summary {
  border-bottom-color: var(--lb-border-soft);
}

.lb-accordion__body {
  padding: 14px 16px 16px;
}

/* ——— Subnav (non-bot pages) ——— */
.lb-subnav:not(.lb-subnav--bot) {
  background: linear-gradient(
    180deg,
    rgba(45, 116, 254, 0.92) 0%,
    rgba(90, 160, 245, 0.88) 72%,
    rgba(168, 212, 240, 0.95) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  padding: 8px 10px;
  box-shadow: 0 10px 28px rgba(45, 116, 254, 0.2);
}

.lb-subnav:not(.lb-subnav--bot) a {
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(15, 23, 42, 0.3);
}

.lb-subnav:not(.lb-subnav--bot) a.is-active {
  color: var(--lb-sky-deep);
  background: #fff;
  border-color: #fff;
  text-shadow: none;
}

/* ——— Buttons (miniapp radii + glass secondary) ——— */
.lb-btn-primary {
  background: var(--lb-accent);
  border-radius: var(--lb-btn-radius);
  box-shadow: 0 6px 18px rgba(45, 116, 254, 0.28);
}

.lb-btn-primary:hover {
  background: var(--lb-accent-hover);
}

.lb-btn-outline {
  border-radius: var(--lb-btn-radius);
  border: 1px solid rgba(45, 116, 254, 0.18);
  color: var(--lb-sky-deep);
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.lb-btn-outline:hover {
  border-color: rgba(45, 116, 254, 0.35);
  background: #f8fbff;
  color: var(--lb-sky-deep);
}

.lb-btn-attach {
  color: var(--lb-sky-deep);
  background: var(--lb-accent-muted-bg);
  border-radius: 8px;
}

.lb-btn-danger {
  border-radius: var(--lb-btn-radius);
}

.lb-stat-tag {
  border-radius: 12px;
}

.lb-stat-tag.is-active {
  color: var(--lb-sky-deep);
  background: #fff;
  border-color: var(--lb-blue);
  box-shadow: 0 4px 14px rgba(45, 116, 254, 0.15);
}

.lb-stat-tag.is-active .lb-stat-tag__count {
  background: var(--lb-blue-soft);
  color: var(--lb-blue-dark);
}

/* ——— Form fields ——— */
.lb-input,
.lb-select,
.lb-textarea {
  background: #fff;
  border: 1px solid var(--lb-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.lb-input:focus,
.lb-select:focus,
.lb-textarea:focus {
  border-color: var(--lb-accent);
  box-shadow: 0 0 0 3px rgba(45, 116, 254, 0.14);
  outline: none;
}

.lb-label {
  color: var(--lb-text);
  font-weight: 600;
  font-size: 0.82rem;
}

/* ——— Tables ——— */
.lb-table-wrap {
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  overflow: hidden;
  background: #fff;
}

.lb-table thead tr {
  background: var(--lb-border-soft);
}

.lb-table th {
  color: var(--lb-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lb-table tbody tr:hover {
  background: #f8fafc;
}

/* ——— Badges & tiles ——— */
.lb-badge--lime,
.lb-tariff-tile {
  background: var(--lb-blue-soft);
  color: var(--lb-blue-dark);
}

.lb-badge--blue {
  background: var(--lb-blue-soft);
  color: var(--lb-blue-dark);
}

a.lb-dash-tile {
  border-radius: var(--lb-radius);
  background: #fff;
  border: 1px solid var(--lb-border);
}

a.lb-dash-tile:hover {
  border-color: var(--lb-accent);
  box-shadow: 0 6px 18px rgba(45, 116, 254, 0.14);
}

/* ——— Login ——— */
body.lb-login-bg {
  background-color: var(--lb-sky);
  background-image: var(--lb-hero-gradient), url("/static/img/hero-bg.png?v=20260721c");
  background-repeat: no-repeat, no-repeat;
  background-position: top center, top center;
  background-size: 100% 480px, 100% auto;
}

.lb-login-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
  background: #fff;
}

.lb-login-logo {
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid rgba(45, 116, 254, 0.2);
  background: #fff;
}

.lb-login-logo-img {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}

.lb-login-title {
  color: var(--lb-text);
  letter-spacing: -0.03em;
}

.lb-login-consent input {
  accent-color: var(--lb-accent);
}

.lb-login-submit {
  border-radius: var(--lb-btn-radius);
  min-height: 48px;
  font-size: 1rem;
}

.lb-login-secondary {
  border-radius: var(--lb-btn-radius);
  color: var(--lb-sky-deep);
  background: #fff;
  border: 1px solid rgba(45, 116, 254, 0.2);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  min-height: 44px;
}

.lb-login-secondary:hover {
  background: #f8fbff;
  border-color: rgba(45, 116, 254, 0.35);
  color: var(--lb-sky-deep);
}

/* ——— Miniapp embed shell ——— */
.lb-bot-miniapp-shell {
  border: none;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(45, 116, 254, 0.2);
  overflow: hidden;
}

@media (max-width: 900px) {
  .lb-topnav {
    padding: 0 1rem;
  }

  .lb-main {
    padding: 0;
  }

  .lb-settings {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 2rem;
    border-radius: 16px 16px 0 0;
    min-height: calc(100vh - var(--lb-topnav-h));
  }

  .lb-settings-nav {
    position: static;
    width: 100%;
  }

  .lb-settings-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .lb-settings-link {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (min-width: 901px) {
  body.lb-body {
    background-attachment: fixed, fixed;
  }

  .lb-main {
    max-width: none;
  }

  .lb-settings,
  .lb-settings--full {
    padding: 1.75rem 2rem 2.75rem;
  }
}


/* ——— Sales funnel metrics plaque ——— */
