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

:root {
  --bg: #faf4ee;
  --panel: #f4e6da;
  --ink: #2e2119;
  --muted: #8c7a6e;
  --accent-1: #b8763f;
  --accent-2: #8c3f52;
  --line: #ecdccb;
  --ok-bg: #eaf3e1;
  --ok-text: #3f7a3a;
  --off-bg: #f6e3de;
  --off-text: #a1442e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
}

a { color: var(--accent-2); }

/* ---------- Navbar ---------- */

.navbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 18px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.navbar .brand {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.navbar .brand span {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Logo mark: brand image (use instead of .brand text if you switch dashboard/login navbar to the logo file) */
.brand-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.brand-logo img {
  height: 28px;
  width: auto;
  display: block;
}
.navbar .meta { color: var(--muted); }
.navbar a { color: var(--muted); text-decoration: none; }
.navbar a:hover { color: var(--accent-1); }

/* ---------- Layout ---------- */

.container { max-width: 1000px; margin: 40px auto; padding: 0 24px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(20, 18, 31, 0.04);
}
.card h2 { font-size: 19px; margin-bottom: 18px; }

/* ---------- Card section headers ---------- */

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.card-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2);
}
.card-icon svg { width: 19px; height: 19px; }
.card-header-text { flex: 1; min-width: 0; }
.card-header-text h3 { font-size: 17px; }
.card-header-text p { margin: 3px 0 0; }
.count-pill {
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

.section-divider {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 22px 0;
}

/* ---------- Story items ---------- */

.story-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fff, var(--panel) 260%);
}
.story-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.story-item-body { flex: 1; min-width: 0; }
.story-item-body .story-title { font-size: 15px; font-weight: 600; font-family: 'Playfair Display', serif; }
.story-item-body .story-date {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-top: 3px;
}
.story-item-body p.muted { margin: 8px 0 0; line-height: 1.6; }
.story-item form { flex-shrink: 0; }

/* ---------- Gallery items ---------- */

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 1 / 1;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item form { position: absolute; top: 8px; right: 8px; }
.gallery-item .btn-small {
  padding: 6px 8px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 8px rgba(20, 18, 31, 0.18);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px 16px;
  color: var(--muted);
  font-size: 13.5px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--panel);
}

/* ---------- Forms ---------- */

.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-form > div:last-child { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--muted);
}

input[type=text], input[type=email], input[type=password], input[type=datetime-local],
input[type=url], input[type=tel], input[type=number], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(184, 118, 63, 0.16);
}

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.55;
  font-family: 'Inter', sans-serif;
}

/* ---------- Select ---------- */

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238a7b68' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select:hover { border-color: var(--accent-1); }

/* ---------- File inputs ---------- */

input[type=file] {
  width: 100%;
  display: block;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  padding: 9px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
input[type=file]:hover { border-color: var(--accent-1); background: #fdf9f0; }
input[type=file]::file-selector-button,
input[type=file]::-webkit-file-upload-button {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  margin-right: 12px;
  transition: transform 0.15s ease;
}
input[type=file]::file-selector-button:hover,
input[type=file]::-webkit-file-upload-button:hover { transform: translateY(-1px); }

.current-photo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.current-photo img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.current-photo a {
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--accent-2);
}
.current-photo a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */

button, .btn-primary {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 6px 18px -8px rgba(140, 63, 82, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
button:hover, .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px rgba(140, 63, 82, 0.55);
}

.btn-small {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  box-shadow: none;
}
.btn-small:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.btn-secondary:hover { color: var(--ink); border-color: var(--ink); box-shadow: none; transform: none; }

.btn-danger {
  background: var(--off-bg);
  color: var(--off-text);
  border: 1px solid transparent;
  box-shadow: none;
}
.btn-danger:hover { background: #f7d9d9; color: var(--off-text); transform: none; box-shadow: none; }

/* ---------- Table ---------- */

.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.table td {
  text-align: left;
  padding: 14px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.table tr:hover td { background: var(--panel); }
.table .actions { display: flex; gap: 8px; }
.table .actions form { display: inline; }
.input-inline {
  width: 100%;
  min-width: 120px;
  padding: 6px 8px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 14px;
}

/* ---------- Badges & alerts ---------- */

.badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-off { background: var(--off-bg); color: var(--off-text); }

.alert {
  padding: 13px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 500;
}
.alert-success { background: var(--ok-bg); color: var(--ok-text); }
.alert-error { background: var(--off-bg); color: var(--off-text); }

/* ---------- Auth pages ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(900px circle at 12% -10%, rgba(184, 118, 63, 0.14), transparent 45%),
    radial-gradient(800px circle at 88% 110%, rgba(140, 63, 82, 0.10), transparent 45%),
    var(--bg);
  padding: 20px;
}
.auth-back { margin: 0; }
.auth-box {
  background: #fff;
  padding: 40px;
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -24px rgba(20, 18, 31, 0.18);
}
.auth-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-1);
  text-align: center;
  margin-bottom: 10px;
}
.auth-box h2 {
  margin: 0 0 26px;
  text-align: center;
  font-size: 21px;
}
.auth-box label { margin-top: 14px; }
.auth-box label:first-of-type { margin-top: 0; }
.auth-box button { width: 100%; margin-top: 22px; justify-content: center; }

/* ---------- Invitation cards (customer dashboard) ---------- */

.invitation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.invitation-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.invitation-card:hover { box-shadow: 0 8px 24px -12px rgba(20, 18, 31, 0.15); transform: translateY(-1px); }
.invitation-card h3 { font-size: 16px; margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 13px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--accent-1); }

@media (max-width: 640px) {
  .navbar { padding: 16px 20px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .container { padding: 0 16px; }
  .grid-form, .invitation-grid { grid-template-columns: 1fr; }
}