:root {
  --bg: #06101a;
  --bg-soft: #0a1622;
  --panel: #101d2c;
  --panel-soft: #152535;
  --steel: #1c3142;
  --steel-soft: #20394e;
  --signal: #ffb54e;
  --line: rgba(184, 214, 255, 0.14);
  --line-strong: rgba(184, 214, 255, 0.24);
  --text: #eff6ff;
  --text-soft: #aebfd4;
  --accent: #4eb4ff;
  --accent-strong: #0f89ff;
  --success: #8ce0a0;
  --danger: #ff8f8f;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(78, 180, 255, 0.12), transparent 24%),
    radial-gradient(circle at right 10%, rgba(255, 181, 78, 0.08), transparent 22%),
    linear-gradient(180deg, #02070d 0%, #07111b 100%);
}

a { color: inherit; }

.shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 12, 20, 0.9);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.header-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #05111d;
  border-color: transparent;
  font-weight: 700;
}

.button-danger {
  border-color: rgba(255, 143, 143, 0.32);
  background: rgba(255, 143, 143, 0.08);
  color: #ffd7d7;
}

.wide {
  width: 100%;
}

.layout {
  padding: 28px 0 40px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 29, 44, 0.96), rgba(8, 18, 29, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 160px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(78, 180, 255, 0));
}

.sidebar h2,
.content h1,
.content h2,
.content h3,
.panel h1,
.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav a {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: var(--text-soft);
  transition: 160ms ease;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(78, 180, 255, 0.09);
}

.sidebar-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.sidebar-box strong {
  font-size: 0.9rem;
}

.sidebar-box span {
  color: var(--text-soft);
  line-height: 1.5;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.section-head p {
  margin: 0;
  max-width: 56ch;
  color: var(--text-soft);
  line-height: 1.6;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stack {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-soft);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(184, 214, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}

select option,
select optgroup {
  background: #101d2c;
  color: var(--text);
}

textarea {
  min-height: 180px;
  resize: vertical;
}

select {
  appearance: none;
}

.message {
  margin-bottom: 16px;
  border-radius: 14px;
  padding: 14px 16px;
}

.message.success {
  background: rgba(140, 224, 160, 0.12);
  border: 1px solid rgba(140, 224, 160, 0.24);
  color: var(--success);
}

.message.error {
  background: rgba(255, 143, 143, 0.12);
  border: 1px solid rgba(255, 143, 143, 0.24);
  color: var(--danger);
}

.offers-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

.offers-subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.offers-subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  text-decoration: none;
}

.offers-subnav a.active {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(78, 180, 255, 0.09);
}

.offers-list {
  display: grid;
  gap: 10px;
}

.offer-link {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.offer-link strong {
  color: var(--text);
}

.offer-link span,
.offer-link small,
.empty-note {
  color: var(--text-soft);
}

.offer-link.active {
  border-color: var(--line-strong);
  background: rgba(78, 180, 255, 0.09);
}

.category-link {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.category-link-copy {
  display: grid;
  gap: 4px;
}

.category-link-copy strong {
  color: var(--text);
}

.category-link-copy span,
.category-link-copy small {
  color: var(--text-soft);
}

.category-order-form {
  display: grid;
}

.category-order-form select {
  min-height: 44px;
}

.security-locks {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.security-lock-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.security-lock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.security-lock-head strong {
  color: var(--text);
}

.security-lock-meta {
  display: flex;
  gap: 10px 16px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.security-lock-agent {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-chip.blocked {
  border-color: rgba(255, 143, 143, 0.32);
  color: #ffd7d7;
  background: rgba(255, 143, 143, 0.1);
}

.offer-editor {
  display: grid;
  gap: 16px;
}

.offer-hint {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(78, 180, 255, 0.08), rgba(255, 181, 78, 0.04));
}

.offer-hint h3 {
  font-size: 1.1rem;
}

.offer-hint p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.delete-form {
  margin-top: 12px;
}

.subpanel {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 24px;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 8, 15, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 0;
  border-radius: 28px;
  border: 1px solid rgba(184, 214, 255, 0.2);
  background:
    radial-gradient(circle at top right, rgba(78, 180, 255, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(17, 31, 46, 0.99), rgba(7, 16, 27, 1));
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.44);
}

.modal-card-small {
  width: min(640px, 100%);
}

.modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(78, 180, 255, 0.4), rgba(255, 181, 78, 0.12), rgba(78, 180, 255, 0.18));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.modal-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(31, 51, 68, 0.96), rgba(19, 33, 46, 0.92));
}

.window-dots {
  display: flex;
  gap: 8px;
}

.window-dots span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.window-dots span:nth-child(1) {
  background: #ff6b6b;
}

.window-dots span:nth-child(2) {
  background: #ffc34d;
}

.window-dots span:nth-child(3) {
  background: #67d98b;
}

.window-title {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
  padding: 24px 24px 0;
}

.modal-head h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.modal-intro {
  max-width: 60ch;
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}

.wizard-form {
  gap: 20px;
  padding: 0 24px 24px;
}

.wizard-step {
  display: none;
  gap: 18px;
}

.wizard-step.is-active {
  display: grid;
}

.wizard-copy p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.upload-box {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  border: 1px dashed rgba(184, 214, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(78, 180, 255, 0.06), rgba(255, 181, 78, 0.04));
}

.upload-preview {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.upload-preview.is-hidden,
.upload-empty.is-hidden {
  display: none;
}

.upload-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.02),
      rgba(255, 255, 255, 0.02) 10px,
      rgba(255, 255, 255, 0.03) 10px,
      rgba(255, 255, 255, 0.03) 20px
    );
}

.upload-field {
  display: grid;
  gap: 8px;
}

.helper-note {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 181, 78, 0.18);
  background: rgba(255, 181, 78, 0.08);
  color: #ffdcb0;
  line-height: 1.5;
}

.generated-link-box {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(78, 180, 255, 0.08), rgba(78, 180, 255, 0.03));
}

.generated-link-box strong {
  font-size: 0.9rem;
}

.generated-link-box span {
  overflow-wrap: anywhere;
  color: var(--text-soft);
}

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

.modal-delete {
  margin: 0 24px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1024px) {
  .admin-layout,
  .offers-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .field-grid,
  .section-head {
    grid-template-columns: 1fr;
    display: grid;
  }
}
