@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=Source+Sans+3:wght@300;400;600&display=swap');

:root {
  --bg-1: #f8f5f2;
  --bg-2: #e9f0f7;
  --bg-3: #f4eaf1;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.35);
  --text: #2c2b2d;
  --muted: #6c6870;
  --accent: #b49acb;
  --accent-2: #91a8d0;
  --shadow: 0 20px 50px rgba(33, 33, 40, 0.12);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, var(--bg-2), transparent 60%),
    radial-gradient(circle at 10% 20%, var(--bg-3), transparent 55%),
    linear-gradient(140deg, var(--bg-1), #fefefe 65%);
}

h1,
h2,
h3,
h4 {
  font-family: 'Playfair Display', serif;
  margin: 0;
}

p {
  margin: 0;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 5vw;
  background: var(--glass-strong);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(33, 33, 40, 0.08);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 5vw 36px;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 43, 45, 0.35);
  backdrop-filter: blur(8px);
}

.admin-modal {
  position: relative;
  width: 360px;
  max-width: 90vw;
  padding: 36px 32px 28px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(33, 33, 40, 0.22);
  backdrop-filter: blur(20px);
  text-align: center;
}

.admin-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
  transition: color 0.2s ease;
}

.admin-modal-close:hover {
  color: var(--text);
  transform: none;
}

.admin-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  margin-bottom: 16px;
}

.admin-modal h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.admin-modal-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.admin-modal-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 154, 203, 0.18);
}

.admin-modal-error {
  font-size: 13px;
  color: #d4566a;
  margin-top: 8px;
}

.admin-modal-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-size: 15px;
}

.admin-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.modal-enter-active,
.modal-leave-active {
  transition: opacity 0.25s ease;
}

.modal-enter-active .admin-modal,
.modal-leave-active .admin-modal {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal-enter-from,
.modal-leave-to {
  opacity: 0;
}

.modal-enter-from .admin-modal {
  transform: scale(0.92) translateY(10px);
  opacity: 0;
}

.modal-leave-to .admin-modal {
  transform: scale(0.95);
  opacity: 0;
}

.brand h1 {
  font-size: 26px;
  letter-spacing: 1px;
}

.brand p {
  color: var(--muted);
  font-size: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: var(--glass-strong);
  box-shadow: 0 12px 24px rgba(33, 33, 40, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-badge:hover {
  background: rgba(255, 255, 255, 0.85);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.user-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.user-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  text-decoration: none;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(145, 168, 208, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

button {
  border: none;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  padding: 10px 18px;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 10px 30px rgba(145, 168, 208, 0.35);
}

button.ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  border: 1px solid var(--line);
}

.main-content {
  flex: 1;
  padding: 28px 0;
  min-height: 0;
}

.footer {
  margin-top: 12px;
  padding: 24px 26px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: 0 -4px 30px rgba(33, 33, 40, 0.06);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

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

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(33, 33, 40, 0.1);
}

.footer-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
}

.footer-divider {
  width: 40px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.5;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-mail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(145, 168, 208, 0.08);
  transition: background 0.2s ease, color 0.2s ease;
}

.footer-mail:hover {
  background: rgba(145, 168, 208, 0.18);
  color: var(--text);
}

.footer-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(180, 154, 203, 0.08);
}

.footer-stat-visit {
  color: var(--accent-2);
  background: rgba(145, 168, 208, 0.08);
}

.footer-copy {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.7;
  letter-spacing: 0.3px;
}

.page-card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(33, 33, 40, 0.1);
  height: 100%;
}

.product-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.product-price {
  font-weight: 600;
  color: var(--accent-2);
}

.product-actions {
  margin-top: 12px;
}

.secondary-link {
  display: inline-flex;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  font-size: 13px;
  transition: background 0.2s ease;
}

.secondary-link:hover {
  background: rgba(255, 255, 255, 0.85);
}

.badge {
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}

.detail-image {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 16px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.buy-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  padding: 12px 22px;
  border-radius: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-field input,
.form-field textarea {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
  font-family: 'Source Sans 3', sans-serif;
}

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

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 12px;
  font-size: 14px;
}

.table tr {
  border-bottom: 1px solid var(--line);
}

.tag {
  font-size: 12px;
  color: var(--muted);
}

.markdown {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

@media (max-width: 900px) {
  .app-body {
    padding: 18px 4vw 28px;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 4vw;
    gap: 12px;
  }

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

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

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-image {
    height: 240px;
  }

  .footer {
    padding: 20px 18px;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }

  .page-card {
    padding: 18px;
  }

  .product-card {
    padding: 14px;
  }

  .product-card img {
    height: 120px;
  }

  .markdown {
    -webkit-line-clamp: 2;
  }
}
