@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600&display=swap");

:root {
  --bg: #080808;
  --panel: #0d0d0d;
  --panel-2: #111111;
  --panel-3: #171717;
  --text: #f0ede8;
  --muted: rgba(240, 237, 232, 0.52);
  --faint: rgba(240, 237, 232, 0.28);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --good: #7ad39b;
  --bad: #ef7777;
  --focus: #f0ede8;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.05), transparent 36%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 36px 36px, 36px 36px, auto;
}

.login-card {
  width: min(390px, 100%);
  border: 1px solid var(--border);
  background: rgba(13, 13, 13, 0.88);
  padding: 34px;
}

.login-card__brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-card__brand strong,
.sidebar__brand strong {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.login-card__brand span,
.sidebar__brand span,
.workspace__eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.login-form,
.field-stack {
  display: grid;
  gap: 16px;
}

label,
.field {
  display: grid;
  gap: 8px;
}

label > span,
.field > span,
.field-label {
  color: rgba(240, 237, 232, 0.46);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--border-strong);
  background: var(--panel-3);
}

.primary-action,
.ghost-action,
.small-action,
.danger-action,
.icon-action {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.primary-action {
  min-height: 42px;
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.primary-action:hover {
  background: var(--text);
  color: var(--bg);
}

.ghost-action,
.small-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 13px;
  color: rgba(240, 237, 232, 0.62);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.ghost-action:hover,
.small-action:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
}

.danger-action:hover {
  color: var(--bad);
  border-color: rgba(239, 119, 119, 0.35);
}

.primary-action:active,
.ghost-action:active,
.small-action:active,
.danger-action:active,
.icon-action:active {
  transform: translateY(1px) scale(0.99);
}

.form-error,
.back-link,
.helper {
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
}

.form-error {
  color: var(--bad);
}

.back-link {
  display: block;
  margin-top: 22px;
  text-align: center;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.back-link:hover {
  color: var(--muted);
}

.admin-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--bg);
  max-width: 100%;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #090909;
}

.sidebar__brand {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar__brand strong {
  font-size: 17px;
}

.sidebar__nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.tab-button,
.sidebar__logout {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 12px;
  text-align: left;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.tab-button svg,
.sidebar__logout svg,
.icon-action svg,
.preview-thumb svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-button span,
.sidebar__logout span {
  font-size: 13px;
}

.tab-button:hover,
.tab-button.is-active,
.sidebar__logout:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.sidebar__logout {
  border-top: 1px solid var(--border);
  padding: 14px 24px;
}

.workspace {
  min-width: 0;
  max-width: 100%;
}

.workspace__topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(14px);
}

.workspace__topbar h1 {
  margin: 2px 0 0;
  font-family: "Playfair Display", serif;
  font-size: 25px;
  font-weight: 500;
}

.workspace__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-line {
  margin: 18px 28px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel);
  font-size: 13px;
}

.status-line.is-good {
  color: var(--good);
  border-color: rgba(122, 211, 155, 0.25);
}

.status-line.is-bad {
  color: var(--bad);
  border-color: rgba(239, 119, 119, 0.25);
}

.view {
  padding: 28px;
}

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

.metric {
  min-height: 130px;
  padding: 22px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.metric strong {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 38px;
  font-weight: 500;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
}

.panel + .panel {
  margin-top: 14px;
}

.panel__head,
.panel__body,
.item-card {
  padding: 18px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.panel__head h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 500;
}

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

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

.item-list {
  display: grid;
  gap: 14px;
}

.item-card {
  border: 1px solid var(--border);
  background: var(--panel);
}

.item-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.item-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.item-card__title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.icon-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.icon-action:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
}

.item-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
}

.preview-thumb {
  min-height: 148px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--panel-2);
  background-size: 20px 20px;
  overflow: hidden;
}

.preview-thumb img,
.preview-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 148px;
  object-fit: cover;
}

.preview-thumb__empty {
  min-height: 148px;
  display: grid;
  place-items: center;
  color: rgba(240, 237, 232, 0.25);
}

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

.check-field {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.check-field input {
  width: auto;
  min-height: auto;
  accent-color: var(--text);
}

.upload-row {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
}

.upload-row__hint {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.upload-row__controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  gap: 10px;
}

.upload-row__controls input[type="file"] {
  min-width: 0;
  overflow: hidden;
}


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

.media-card {
  border: 1px solid var(--border);
  background: var(--panel);
  overflow: hidden;
}

.media-card img,
.media-card .preview-thumb__empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  object-fit: cover;
}

.media-card__body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.media-card__body strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card__body code {
  color: var(--faint);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.empty-state {
  padding: 34px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .overview-grid,
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .sidebar {
    position: relative;
    height: auto;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .sidebar__nav {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .tab-button {
    width: auto;
    flex: 0 0 auto;
  }

  .workspace__topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace__actions {
    width: 100%;
  }

  .workspace__actions > * {
    flex: 1;
    min-width: 0;
  }

  .view,
  .workspace__topbar {
    padding-inline: 18px;
  }

  .grid-2,
  .grid-3,
  .overview-grid,
  .media-grid,
  .item-grid {
    grid-template-columns: 1fr;
  }

  .upload-row__controls {
    grid-template-columns: 1fr;
  }
}
