:root {
  --bg: #101010;
  --panel: rgba(18, 19, 21, 0.86);
  --panel-solid: #151719;
  --panel-soft: #1d2023;
  --text: #f2f0ea;
  --muted: #a8a6a0;
  --dim: #777a7d;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #b3121d;
  --primary-strong: #e3202f;
  --blue: #48a7ff;
  --ok: #62d68b;
  --warn: #f1b852;
  --bad: #ff626d;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(16, 16, 16, 0.96) 0%, rgba(16, 16, 16, 0.75) 42%, rgba(16, 16, 16, 0.96) 100%),
    linear-gradient(180deg, rgba(16, 16, 16, 0.42) 0%, #101010 82%),
    url("Screenshot_59.png") center top / cover fixed no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px);
  mix-blend-mode: screen;
}

body.preview-open {
  overflow: hidden;
}

.container {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 42px auto 34px;
}

body.admin-mode .container {
  width: min(1360px, calc(100% - 32px));
}

body.admin-mode .social-footer {
  display: none;
}

.hero-card,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(18, 19, 21, 0.88), rgba(8, 9, 10, 0.9));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(10px);
}

.hero-card {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
  overflow: hidden;
  padding: clamp(22px, 4vw, 48px);
  background:
    linear-gradient(90deg, rgba(10, 11, 12, 0.72) 0%, rgba(10, 11, 12, 0.45) 45%, rgba(10, 11, 12, 0.95) 100%),
    linear-gradient(180deg, rgba(10, 11, 12, 0.16) 0%, rgba(10, 11, 12, 0.94) 100%),
    url("Screenshot_59.png") center center / cover no-repeat;
}

.card {
  padding: clamp(18px, 3vw, 28px);
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  width: max-content;
  margin: 0 0 18px;
  padding: 8px 12px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 0.96;
}

h1 {
  max-width: 620px;
  font-size: clamp(46px, 6.2vw, 86px);
  text-transform: uppercase;
  font-weight: 900;
  overflow-wrap: normal;
}

h2 {
  font-size: clamp(30px, 5vw, 58px);
}

.subtitle {
  max-width: 560px;
  margin: 0 0 24px;
  color: #d2d0ca;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.14;
}

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

.hero-stats span {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 8px 12px;
  color: #e8e5dc;
  background: rgba(0, 0, 0, 0.34);
  font-weight: 800;
}

.form-panel {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: clamp(18px, 2.2vw, 24px);
  background: rgba(13, 14, 16, 0.84);
}

form {
  min-width: 0;
  display: grid;
  gap: 14px;
}

label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #e9e6df;
  font-weight: 800;
}

input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.07);
}

input::placeholder {
  color: #7f8082;
}

input:focus {
  outline: 2px solid rgba(72, 167, 255, 0.46);
  border-color: var(--blue);
}

.file-control {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.file-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 7px 12px;
  color: #fff;
  background: linear-gradient(180deg, var(--primary-strong) 0%, var(--primary) 100%);
  font-weight: 900;
  white-space: nowrap;
}

.file-name {
  color: #d8d5ce;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

small {
  color: var(--muted);
  font-weight: 500;
}

.warn {
  margin: 0;
  color: var(--warn);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.btn {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 11px 16px;
  color: #fff;
  background: linear-gradient(180deg, var(--primary-strong) 0%, var(--primary) 100%);
  box-shadow: 0 12px 26px rgba(179, 18, 29, 0.25);
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, filter 0.16s ease;
}

.btn:hover {
  border-color: rgba(255, 255, 255, 0.34);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  color: #f1f0eb;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.btn-danger {
  background: rgba(255, 98, 109, 0.12);
  color: #ffd9dc;
  box-shadow: none;
  border-color: rgba(255, 98, 109, 0.32);
}

.btn-check {
  width: 100%;
  margin-top: 8px;
}

.message {
  min-height: 24px;
  margin: 12px 0;
  font-weight: 800;
  line-height: 1.35;
}

.message.ok {
  color: var(--ok);
}

.message.warn-msg {
  color: var(--warn);
}

.message.bad {
  color: var(--bad);
}

.hidden {
  display: none;
}

.admin-head,
.admin-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.admin-head {
  margin-bottom: 18px;
}

.admin-tools {
  justify-content: flex-end;
  margin-bottom: 16px;
}

.admin-filter {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-filter label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.admin-filter input {
  width: 100%;
}

.admin-tabs {
  display: none;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-tab {
  min-width: 0;
  min-height: 42px;
  flex: 1 1 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.admin-tab.is-active {
  border-color: rgba(72, 167, 255, 0.58);
  color: #fff;
  background: rgba(72, 167, 255, 0.18);
}

.admin-dashboard {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card,
.traffic-card,
.list,
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.kpi-card {
  min-height: 94px;
  padding: 14px;
}

.kpi-card p,
.traffic-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kpi-card strong {
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.traffic-card {
  padding: 14px;
}

.traffic-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
}

.bar-col {
  display: grid;
  gap: 5px;
  justify-items: center;
}

.bar {
  width: 100%;
  min-height: 6px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--primary-strong) 100%);
}

.bar-col span {
  color: var(--dim);
  font-size: 10px;
}

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

#admin-card h3 {
  margin-bottom: 10px;
  font-size: clamp(22px, 2.6vw, 34px);
}

.list {
  min-height: 190px;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
  background: rgba(0, 0, 0, 0.24);
}

.item {
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
}

.item-title {
  margin-bottom: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.meta-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #dedbd4;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-line {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-size: 14px;
}

.item-line strong {
  color: var(--blue);
  text-align: right;
  overflow-wrap: anywhere;
}

.item-files {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.attachment-link {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px;
  background: rgba(0, 0, 0, 0.22);
}

button.attachment-link {
  width: 100%;
  border-color: var(--line);
  color: #78bdff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.item-files a,
.attachment-link {
  color: #78bdff;
  text-decoration: none;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.item-files a:hover,
.attachment-link:hover {
  text-decoration: underline;
}

.attachment-preview {
  width: 74px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.attachment-pdf {
  color: #fff;
  border: 1px solid rgba(227, 32, 47, 0.36);
  background: rgba(227, 32, 47, 0.18);
  font-weight: 900;
}

.preview-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.preview-modal.hidden {
  display: none;
}

.preview-dialog {
  position: relative;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: grid;
  gap: 10px;
}

.preview-image {
  max-width: 100%;
  max-height: calc(100vh - 104px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  object-fit: contain;
  background: #080808;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.preview-caption {
  color: #e7e3da;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.item-actions {
  margin-top: 8px;
}

.item .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item .mini {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.empty {
  margin: 0;
  color: var(--dim);
  font-weight: 700;
}

.social-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 42px;
  color: var(--muted);
  font-weight: 800;
}

.social-footer p {
  margin: 0 0 10px;
}

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

.social-btn {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.social-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

.social-btn.telegram {
  border-color: rgba(72, 167, 255, 0.42);
}

.social-btn.instagram {
  border-color: rgba(227, 32, 47, 0.42);
}

@media (max-width: 980px) {
  body {
    background:
      linear-gradient(180deg, rgba(16, 16, 16, 0.58) 0%, #101010 72%),
      url("Screenshot_59.png") center top / cover fixed no-repeat;
  }

  .hero-card {
    min-height: auto;
    grid-template-columns: 1fr;
    align-items: start;
    background:
      linear-gradient(180deg, rgba(10, 11, 12, 0.38) 0%, rgba(10, 11, 12, 0.96) 68%),
      url("Screenshot_59.png") center top / cover no-repeat;
  }

  .hero-copy {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

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

  .traffic-bars {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    row-gap: 10px;
  }

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

  .admin-tabs {
    display: flex;
  }

  .admin-column {
    display: none;
  }

  .admin-column.is-active {
    display: block;
  }
}

@media (max-width: 640px) {
  .container,
  body.admin-mode .container,
  .social-footer {
    width: min(100% - 20px, 1180px);
  }

  .container {
    margin-top: 10px;
  }

  .hero-card,
  .card {
    border-radius: 0;
  }

  .hero-card {
    padding: 16px;
  }

  .hero-copy {
    min-width: 0;
    min-height: 340px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(38px, 11.8vw, 50px);
    overflow-wrap: anywhere;
  }

  .subtitle {
    max-width: 100%;
    font-size: 18px;
    overflow-wrap: anywhere;
  }

  .hero-stats {
    gap: 8px;
  }

  .hero-stats span {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .form-panel {
    padding: 16px;
    overflow: hidden;
  }

  .file-control {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .file-button {
    width: 100%;
  }

  .file-name {
    white-space: normal;
  }

  .admin-head,
  .admin-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-tools .btn,
  .admin-head .btn {
    width: 100%;
  }

  .kpi-grid,
  .social-links {
    grid-template-columns: 1fr;
  }
}
