:root {
  --black: #050505;
  --ink: #101010;
  --red: #e30613;
  --paper: #f4f1ed;
  --white: #fff;
  --muted: #77716d;
  --line: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: Manrope, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  background: #0d0d0d;
}

.admin-header span,
.form-head p,
.list-head p,
.map-toolbar span,
.marker-list article span {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-header h1 {
  margin: 8px 0 0;
  font-family: Oswald, Manrope, Arial, sans-serif;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  text-transform: uppercase;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.admin-nav form {
  margin: 0;
}

.admin-header a,
.ghost-button,
.admin-nav button {
  padding: 14px 20px;
  background: var(--red);
  font-weight: 900;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #050505;
}

.workspace {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.marker-form,
.map-card,
.marker-list {
  border: 1px solid var(--line);
  background: #101010;
}

.marker-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.form-head {
  margin-bottom: 8px;
}

.form-head p {
  margin: 0 0 8px;
}

.form-head strong {
  display: block;
  max-width: 320px;
  font-size: 20px;
  line-height: 1.2;
}

label {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #050505;
  color: var(--white);
  font: inherit;
  padding: 0 14px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(227, 6, 19, 0.8);
  outline-offset: 0;
}

textarea {
  min-height: 118px;
  padding: 14px;
  resize: vertical;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--red);
}

.errorlist {
  margin: 0;
  padding: 0;
  color: #ff9a9a;
  list-style: none;
  font-size: 12px;
}

button {
  min-height: 54px;
  border: 0;
  background: var(--red);
  color: var(--white);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.map-card {
  position: relative;
  min-height: 620px;
  overflow: hidden;
}

.map-toolbar {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(5, 5, 5, 0.86);
  color: var(--white);
}

.map-toolbar p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.admin-map {
  width: 100%;
  height: 100%;
  min-height: 620px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 58px),
    #151515;
}

.api-warning {
  position: absolute;
  inset: auto 24px 24px;
  padding: 18px;
  background: var(--red);
  color: var(--white);
  font-weight: 900;
}

.marker-list {
  margin-top: 22px;
  padding: 24px;
}

.list-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.list-head p,
.list-head span {
  margin: 0;
}

.list-head span {
  color: rgba(255, 255, 255, 0.58);
}

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

.marker-list article {
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #0b0b0b;
}

.marker-list h2 {
  margin: 14px 0 10px;
  font-size: 22px;
}

.marker-list p {
  color: rgba(255, 255, 255, 0.68);
}

.marker-list small {
  color: rgba(255, 255, 255, 0.48);
}

.login-shell {
  display: grid;
  min-height: 100svh;
  padding: 24px;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.14), transparent 34%),
    var(--black);
}

.login-card {
  width: min(520px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  background: #101010;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
}

.login-card > span {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 12px 0 26px;
  font-family: Oswald, Manrope, Arial, sans-serif;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1;
  text-transform: uppercase;
}

.login-card form {
  display: grid;
  gap: 16px;
}

.login-error {
  padding: 12px 14px;
  background: rgba(227, 6, 19, 0.18);
  color: #ffb4b4;
  font-weight: 800;
}

.product-forms {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.4fr;
  gap: 18px;
  align-items: start;
}

.compact-form {
  align-content: start;
}

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

.product-form .form-head,
.product-form .errorlist,
.product-form label:has(textarea),
.product-form button {
  grid-column: 1 / -1;
}

.catalog-panel {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  background: #101010;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(4, minmax(130px, 0.7fr)) auto auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 18px;
}

.filter-bar button {
  padding-inline: 18px;
}

.product-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.product-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #090909;
}

.product-table th,
.product-table td {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.product-table th {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-table td {
  color: rgba(255, 255, 255, 0.76);
}

.clickable-row {
  cursor: pointer;
  transition: background 0.18s ease, outline-color 0.18s ease;
}

.clickable-row:hover,
.clickable-row:focus {
  background: rgba(227, 6, 19, 0.12);
  outline: 1px solid rgba(227, 6, 19, 0.55);
  outline-offset: -1px;
}

.product-table strong,
.product-table span {
  display: block;
}

.product-table strong {
  color: var(--white);
}

.product-cell {
  min-width: 310px;
}

.product-title-link {
  display: inline-block;
  color: var(--white);
  font-size: 17px;
  font-weight: 900;
}

.product-title-link:hover {
  color: var(--red);
}

.product-table span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.table-actions form {
  margin: 0;
}

.table-actions a,
.table-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #050505;
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
}

.table-actions .primary-action {
  border-color: var(--red);
  background: var(--red);
}

.table-actions a:hover,
.table-actions button:hover {
  background: var(--red);
}

.single-panel {
  width: min(920px, 100%);
}

.edit-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.45fr);
  gap: 12px;
  margin-top: 16px;
}

.edit-actions form {
  margin: 0;
}

.edit-actions button {
  width: 100%;
}

.danger-button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #050505;
}

.danger-button:hover {
  background: var(--red);
}

.media-forms {
  grid-template-columns: repeat(3, 1fr);
}

.media-lists {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.media-list {
  min-width: 0;
}

.media-list article,
.empty-state {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #090909;
}

.media-list article strong {
  color: var(--white);
}

.media-list article p,
.empty-state {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
}

.media-list article form {
  margin: 0;
}

.media-list article button {
  width: 100%;
  min-height: 42px;
}

.media-list .ghost-button {
  min-height: 42px;
}

@media (max-width: 980px) {
  .workspace,
  .list-grid,
  .product-forms,
  .media-forms,
  .media-lists,
  .edit-actions,
  .filter-bar {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .admin-shell {
    padding: 12px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-toolbar {
    position: static;
    margin: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-card,
  .admin-map {
    min-height: 480px;
  }
}
