:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1d2430;
  --muted: #6d798d;
  --line: #d8dee9;
  --brand: #2fda76;
  --brand-dark: #25b75f;
  --btn-dark: #2c3139;
  --blue: #2f83f2;
  --sidebar: #06364f;
  --sidebar-hover: #1e506a;
  --danger-bg: #fce7e7;
  --danger: #ba2c2c;
}

* {
  box-sizing: border-box;
  font-family: Inter, Arial, sans-serif;
}

body {
  margin: 0;
  color: var(--text);
}

.bg {
  background: var(--bg);
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-wrap {
  width: 100%;
  max-width: 460px;
  padding: 24px;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.brand-logo {
  width: 52px;
  height: 52px;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.tab {
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  border-color: var(--brand);
  background: #ebfff2;
}

.form {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.form.active {
  display: flex;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  font-size: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.btn-primary,
.btn-secondary,
.btn-dark,
.btn-light,
.btn-outline {
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  border: 1px solid transparent;
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(0.96);
}

.btn-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.btn-dark {
  border: 1px solid transparent;
  background: var(--btn-dark);
  color: #fff;
}

.btn-light {
  border: 1px solid var(--line);
  background: #f7f9fc;
  color: var(--text);
}

.btn-outline {
  border: 1px solid var(--blue);
  background: #fff;
  color: var(--blue);
}

.msg {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
}

.panel-bg {
  background: var(--bg);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 98px 1fr;
}

.leftbar {
  background: var(--sidebar);
  color: #d2e4f3;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
}

.side-item {
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 14px;
  padding: 12px 6px;
  cursor: pointer;
}

.side-item:hover {
  background: var(--sidebar-hover);
}

.side-item.active {
  background: #2fda7630;
  color: #fff;
}

.side-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #ffffff18;
  font-size: 18px;
}

.side-item small {
  font-size: 13px;
  text-align: center;
  line-height: 1.1;
}

.side-bottom {
  margin-top: auto;
  border-top: 1px solid #ffffff1a;
  padding-top: 8px;
}

.workspace {
  min-width: 0;
}

.top-warning {
  background: #fff0dd;
  color: #bd5d00;
  border-bottom: 1px solid #f3d5b2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
}

.top-warning b {
  color: #9b4500;
}

.workspace-body {
  padding: 22px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-title {
  font-size: 44px;
  margin: 0 0 18px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
}

.section-title {
  margin: 0;
  font-size: 44px;
  line-height: 1.1;
}

.muted {
  color: var(--muted);
}

.tabs-line {
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.tabs-line button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 11px 2px;
  font-size: 36px;
  font-weight: 600;
  border-bottom: 4px solid transparent;
  cursor: pointer;
}

.tabs-line button.small {
  font-size: 20px;
}

.tabs-line button.active {
  color: var(--blue);
  border-color: var(--blue);
}

.split {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
}

.hero {
  border-radius: 24px;
  background: linear-gradient(135deg, #121c28 0%, #182432 55%, #21463a 100%);
  color: #fff;
  padding: 24px;
  margin-bottom: 20px;
}

.hero h2 {
  font-size: 56px;
  line-height: 1;
  margin: 0 0 14px;
}

.hero p {
  margin: 0 0 14px;
  color: #d8e5f2;
  max-width: 840px;
  font-size: 22px;
}

.hero strong {
  color: #2fda76;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.feature-card {
  background: #ffffff10;
  border: 1px solid #ffffff1a;
  border-radius: 16px;
  padding: 14px;
}

.feature-card h4 {
  margin: 0 0 8px;
  font-size: 20px;
}

.feature-card p {
  margin: 0;
  color: #d0deee;
  font-size: 16px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.service-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.service-tile .price {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  background: #eff4fb;
}

.service-tile .free {
  background: #0ecf5e;
  color: #fff;
}

.sticky-card {
  position: sticky;
  top: 16px;
}

.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rate-row:last-child {
  border-bottom: 0;
}

.badge-error {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

.tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  padding: 12px;
  box-shadow: 0 20px 40px #0f18230f;
  z-index: 3;
}

.badge-error:hover .tooltip {
  display: block;
}

.banner-alert {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f1c0c0;
  border-left: 4px solid var(--danger);
  border-radius: 12px;
  padding: 14px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.faq-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 14px;
  text-align: left;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.faq-a {
  display: none;
  padding: 0 14px 14px;
  color: var(--muted);
}

.faq-item.open .faq-a {
  display: block;
}

.field-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.switch {
  appearance: none;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #ccd6e3;
  position: relative;
  cursor: pointer;
}

.switch::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.switch:checked {
  background: #30d86f;
}

.switch:checked::after {
  transform: translateX(20px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #1118278f;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 22px;
}

.modal header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.modal h3 {
  margin: 0;
  font-size: 44px;
}

.modal h4 {
  margin: 0 0 8px;
  font-size: 24px;
}

.close-x {
  border: 0;
  background: transparent;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  color: #6f7b8d;
}

.crm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.crm-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  font-size: 34px;
  text-align: center;
  font-weight: 700;
  color: #8a97ab;
}

.crm-item.active {
  border-color: #9ed2ff;
  color: #3da5f0;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.channel-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  text-align: center;
}

.step-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.step-list li {
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 22px;
}

.step-list b {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ebeff5;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.qr-box {
  background: #f3f5f8;
  border-radius: 16px;
  min-height: 280px;
  display: grid;
  place-items: center;
}

.spinner {
  width: 62px;
  height: 62px;
  border: 6px solid #d7e3f4;
  border-top-color: #3f95ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.help-menu {
  background: #002f46;
  color: #d8e8f6;
  border-radius: 20px;
  padding: 18px;
}

.help-menu h5 {
  margin: 14px 0 8px;
  font-size: 30px;
}

.help-menu a {
  color: #d8e8f6;
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
  font-size: 26px;
}

.help-menu hr {
  border: 0;
  border-top: 1px solid #ffffff2b;
  margin: 14px 0;
}

@media (max-width: 1280px) {
  .section-title {
    font-size: 34px;
  }

  .tabs-line button {
    font-size: 26px;
  }

  .hero h2 {
    font-size: 46px;
  }
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .leftbar {
    flex-direction: row;
    overflow: auto;
    white-space: nowrap;
  }

  .side-item {
    min-width: 86px;
  }

  .side-bottom {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .service-grid,
  .channel-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .modal h3 {
    font-size: 30px;
  }
}
