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

:root {
  --bg-page: #0a0806;
  --bg-sidebar: #060503;
  --bg-card: #12100e;
  --bg-muted: #1a1614;
  --gold: #d4a853;
  --gold-soft: #d4a8531f;
  --text-main: #f5f0e8;
  --text-muted: #8a8279;
  --border: #1a1610;
  --radius: 14px;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Manrope", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-main);
}

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

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

.admin-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 272px 1fr;
}

.admin-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 70px;
  height: 50px;
  border-radius: 11px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  font-family: var(--font-serif);
  letter-spacing: 0.12em;
  font-size: 16px;
}

.brand-sub {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-nav {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.admin-nav a {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 12px;
  color: #cfc6bc;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.admin-nav a:hover,
.admin-nav a.is-active {
  border-color: rgba(212, 168, 83, 0.35);
  background: var(--gold-soft);
  color: var(--gold);
}

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

.sidebar-meta {
  color: var(--text-muted);
  font-size: 12px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--gold);
  color: #0e0c0a;
}

.btn-ghost {
  border-color: #2a2218;
  background: #12100e;
  color: var(--text-main);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  border-color: rgba(217, 45, 32, 0.45);
  background: rgba(217, 45, 32, 0.08);
  color: #fda29b;
}

.btn.block {
  width: 100%;
}

.admin-main {
  padding: 20px 22px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.admin-topbar h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 500;
}

.admin-topbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  padding: 10px 12px;
  border: 1px solid #2a2218;
  border-radius: 999px;
  color: #cfc6bc;
  font-size: 13px;
}

.sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #2a2218;
  background: #12100e;
  color: var(--text-main);
}

.admin-notice {
  border: 1px solid #2a2218;
  background: #12100e;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.admin-notice.warning {
  border-color: rgba(212, 168, 83, 0.45);
  background: rgba(212, 168, 83, 0.1);
  color: #ebce91;
}

.admin-notice.error {
  border-color: rgba(217, 45, 32, 0.5);
  background: rgba(217, 45, 32, 0.12);
  color: #fda29b;
}

.admin-notice.success {
  border-color: rgba(18, 183, 106, 0.5);
  background: rgba(18, 183, 106, 0.14);
  color: #75e0a7;
}

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

.stat-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.stat-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
  font-family: var(--font-serif);
}

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

.admin-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 16px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 20px;
  font-family: var(--font-serif);
  font-weight: 500;
}

.card-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #1f1a16;
  font-size: 13px;
  vertical-align: top;
}

.admin-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
}

.pill.new {
  color: #fef0c7;
  background: rgba(212, 168, 83, 0.18);
  border: 1px solid rgba(212, 168, 83, 0.35);
}

.pill.read {
  color: #a4bcfd;
  background: rgba(68, 76, 231, 0.2);
  border: 1px solid rgba(68, 76, 231, 0.3);
}

.pill.replied {
  color: #75e0a7;
  background: rgba(18, 183, 106, 0.2);
  border: 1px solid rgba(18, 183, 106, 0.35);
}

.pill.archived {
  color: #c5c0b8;
  background: rgba(138, 130, 121, 0.15);
  border: 1px solid rgba(138, 130, 121, 0.3);
}

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

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

.form-group {
  display: grid;
  gap: 6px;
}

.form-group label {
  color: var(--text-muted);
  font-size: 12px;
}

.input,
.textarea,
.select {
  width: 100%;
  border-radius: 11px;
  border: 1px solid #2a2218;
  background: #100f0c;
  color: var(--text-main);
  padding: 10px 12px;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: 2px solid rgba(212, 168, 83, 0.35);
  border-color: var(--gold);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.form-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.image-card {
  border: 1px solid #1f1a16;
  border-radius: 12px;
  background: #100f0c;
  overflow: hidden;
}

.image-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.image-card-body {
  padding: 10px;
  display: grid;
  gap: 8px;
}

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

.message-item {
  border: 1px solid #1f1a16;
  border-radius: 12px;
  padding: 11px;
  background: #100f0c;
}

.message-item h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.message-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top right, #1a140d, transparent 48%), var(--bg-page);
}

.login-card {
  width: min(440px, 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  padding: 24px;
}

.login-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 500;
}

.login-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.login-status {
  margin-top: 10px;
  font-size: 13px;
  min-height: 18px;
}

.login-status.error {
  color: #fda29b;
}

.login-status.success {
  color: #75e0a7;
}

.empty {
  border: 1px dashed #2b2218;
  border-radius: 12px;
  padding: 20px;
  color: var(--text-muted);
  text-align: center;
}

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

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 292px);
    transform: translateX(-104%);
    transition: transform 0.25s ease;
    z-index: 90;
  }

  body.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }
}

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

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

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

@media (max-width: 600px) {
  .admin-main {
    padding: 16px;
  }

  .admin-topbar {
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

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

.gallery-video-thumb {
  position: relative;
}

.video-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(212, 168, 83, 0.9);
  color: #0d0b09;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
