@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Unbounded:wght@500;700&display=swap");

:root {
  --brand: #fed42b;
  --brand-strong: #f8c400;
  --brand-soft: #fff4bf;
  --ink: #161a2b;
  --ink-soft: #555d75;
  --bg: #eef1f7;
  --surface: #ffffff;
  --line: #d9deeb;
  --shadow: 0 14px 34px rgba(24, 30, 60, 0.1);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 420px at -10% -10%, #fff7d2 0%, transparent 52%),
    radial-gradient(800px 300px at 105% 0%, #fff1b0 0%, transparent 50%),
    linear-gradient(180deg, #f8f9fc 0%, #edf1f8 100%);
  min-height: 100vh;
}

.layout {
  max-width: 1380px;
  margin: 0 auto;
  padding: 22px 20px 30px;
}

.hero {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid #e8dc9f;
  padding: 24px 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  background:
    linear-gradient(115deg, rgba(254, 212, 43, 0.26) 0%, rgba(254, 212, 43, 0.05) 38%, rgba(255, 255, 255, 0.92) 100%),
    #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(254, 212, 43, 0.65), rgba(254, 212, 43, 0));
}

.hero h1 {
  margin: 6px 0 10px;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(1.55rem, 2.2vw, 2.15rem);
}

.hero__kicker {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #706013;
}

.hero__meta {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 600;
}

.hero__right {
  z-index: 1;
  text-align: right;
  color: #2f3246;
  font-size: 1rem;
}

.hero__right p {
  margin: 7px 0;
}

.hero__right strong {
  font-weight: 800;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 16px;
}

.tab {
  border: 1px solid #d4dbee;
  background: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  color: #2b324a;
  font-weight: 800;
  transition: all .18s ease;
}

.tab:hover {
  border-color: #c7b04f;
  background: #fff9de;
}

.tab--active {
  border-color: #c7a400;
  background: linear-gradient(180deg, #ffe168 0%, #fed42b 100%);
  color: #1f2438;
  box-shadow: 0 9px 20px rgba(210, 170, 20, 0.24);
}

main {
  min-width: 0;
}

.panel {
  display: none;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  animation: panelIn .26s ease;
}

.panel--active {
  display: grid;
}

.panel[data-panel="auth"] > .card,
.panel[data-panel="support"] > .card {
  grid-column: span 6;
}

.panel[data-panel="license"] > .card,
.panel[data-panel="sync"] > .card {
  grid-column: 1 / -1;
}

.panel[data-panel="settings"] > .card:nth-child(1),
.panel[data-panel="settings"] > .card:nth-child(2),
.panel[data-panel="settings"] > .card:nth-child(3) {
  grid-column: span 4;
}

.panel[data-panel="settings"] > .card:nth-child(4) {
  grid-column: 1 / -1;
}

.card {
  min-width: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, #fff 100%);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card h2 {
  margin: 0 0 14px;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  letter-spacing: -0.01em;
}

.form {
  display: grid;
  gap: 12px;
}

.form.inline {
  gap: 12px;
}

.form.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form.grid-2 > button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
}

#mappingForm > button[type="submit"],
#syncStatusForm > button[type="submit"],
#filtersForm > button[type="submit"] {
  justify-self: start;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 0.93rem;
  color: #3b4158;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  min-width: 0;
  border: 1px solid #d7deef;
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: #fdfdff;
  color: var(--ink);
  transition: border-color .14s ease, box-shadow .14s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #d5b418;
  box-shadow: 0 0 0 3px rgba(254, 212, 43, 0.26);
}

textarea {
  resize: vertical;
}

button,
.link-button {
  border: 1px solid #c9a602;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffe57d 0%, var(--brand) 100%);
  color: #1d2133;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 11px 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

button:hover,
.link-button:hover {
  transform: translateY(-1px);
  filter: saturate(1.05);
  box-shadow: 0 10px 20px rgba(222, 176, 13, 0.28);
}

button:active,
.link-button:active {
  transform: translateY(0);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.link {
  color: #6f5e14;
  text-decoration: none;
  font-weight: 800;
}

.link:hover {
  color: #43390e;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.93rem;
  color: #2f354f;
  font-weight: 600;
}

.checkbox input {
  width: 17px;
  height: 17px;
  accent-color: #d9ad00;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.stats div {
  border: 1px solid #e2e7f4;
  border-radius: 13px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}

.stats span {
  display: block;
  font-size: 0.76rem;
  color: #717894;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
}

.stats strong {
  display: block;
  margin-top: 5px;
  font-size: 1.04rem;
}

.mapping-table-wrap {
  overflow: auto;
  border: 1px solid #e3e8f6;
  border-radius: 13px;
  padding: 10px;
  background: #fcfdff;
}

.mapping-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mapping-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff5cc;
}

.mapping-table th,
.mapping-table td {
  border: 1px solid #e0e6f3;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.mapping-table td strong {
  font-size: 0.94rem;
}

.mapping-table td small {
  color: #6e7593;
  font-weight: 500;
}

.mapping-table select {
  width: 100%;
}

.code {
  margin: 12px 0 0;
  border-radius: 12px;
  border: 1px solid #383f5f;
  background: linear-gradient(160deg, #23293d 0%, #161a2a 100%);
  color: #f7f8ff;
  padding: 12px;
  min-height: 76px;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  min-width: 240px;
  max-width: min(450px, calc(100vw - 36px));
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e7f3;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast--show {
  opacity: 1;
  transform: translateY(0);
}

.toast--error {
  border-color: #f3d1d1;
  color: #7b1f2a;
}

@keyframes panelIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .panel[data-panel="settings"] > .card:nth-child(1),
  .panel[data-panel="settings"] > .card:nth-child(2),
  .panel[data-panel="settings"] > .card:nth-child(3) {
    grid-column: span 6;
  }
}

@media (max-width: 940px) {
  .hero {
    flex-direction: column;
  }

  .hero__right {
    text-align: left;
  }

  .panel[data-panel="auth"] > .card,
  .panel[data-panel="support"] > .card,
  .panel[data-panel="settings"] > .card:nth-child(1),
  .panel[data-panel="settings"] > .card:nth-child(2),
  .panel[data-panel="settings"] > .card:nth-child(3),
  .panel[data-panel="settings"] > .card:nth-child(4) {
    grid-column: 1 / -1;
  }

  .form.grid-2 {
    grid-template-columns: 1fr;
  }
}
