/* ============================================================
   HAVN — Theme 1: Classic Light (Rendering #3)
   SAFE FULL STYLESHEET (includes Admin Card Grid)
   ============================================================ */

:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, 0.08);

  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 12px;

  --primary: #111827;
  --primaryText: #ffffff;
  --ghost: rgba(17,24,39,0.06);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  margin: 0;
}

a { color: inherit; }

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.page { padding-top: 34px; }

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.hero h1 {
  font-size: 34px;
  margin: 0;
  letter-spacing: -0.02em;
}

.hero .sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

hr.sep {
  margin: 22px 0 10px;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------
   Inputs & Buttons
   ------------------------------------------------------------ */

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  outline: none;
  box-shadow: none;
}

.input:focus {
  border-color: rgba(17,24,39,0.22);
}

.btn {
  appearance: none;
  border: 1px solid rgba(17,24,39,0.16);
  background: var(--primary);
  color: var(--primaryText);
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(1px); }

.btn.ghost {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(17,24,39,0.03);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(17,24,39,0.05);
  border: 1px solid rgba(17,24,39,0.08);
  color: rgba(17,24,39,0.80);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

/* ------------------------------------------------------------
   Notice / Alerts
   ------------------------------------------------------------ */

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.notice.error {
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
  color: rgba(153, 27, 27, 1);
}

/* ------------------------------------------------------------
   KPI Cards
   ------------------------------------------------------------ */

.kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 980px) {
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .kpi { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}

.box.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.box.card .label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}

.box.card .value {
  font-size: 22px;
  font-weight: 900;
  margin-top: 8px;
}

/* ------------------------------------------------------------
   Utility
   ------------------------------------------------------------ */

.muted {
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono";
  font-size: 12px;
  opacity: 0.85;
}

.empty {
  padding: 22px;
  border-radius: 16px;
  border: 1px dashed rgba(17,24,39,0.20);
  background: rgba(255,255,255,0.7);
  color: rgba(17,24,39,0.7);
  font-weight: 800;
}

/* ============================================================
   ADMIN — LISTING CARD GRID (FINAL)
   Perfect aligned cards, big cover images
   ============================================================ */

#grid.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

@media (max-width: 1024px) {
  #grid.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #grid.grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.listing-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-height: 360px;
}

.listing-card__media {
  display: block;
  width: 100%;
  height: 220px;
  background: #f3f4f6;
  overflow: hidden;
  flex-shrink: 0;
}

.listing-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-card__placeholder {
  height: 220px;
  display: grid;
  place-items: center;
  color: #6b7280;
  font-size: 13px;
  font-weight: 900;
  background: #f3f4f6;
}

.listing-card__body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 140px;
}

.listing-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.listing-card__title {
  flex: 1;
  min-width: 0;
}

.listing-card__title a {
  font-weight: 900;
  font-size: 15px;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-card__title a:hover {
  text-decoration: underline;
}

.listing-card__meta {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.listing-card__meta .price {
  font-weight: 900;
  font-size: 15px;
  color: var(--text);
}

.listing-card__meta .muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.status-chip {
  white-space: nowrap;
}

.listing-card__actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.listing-card__actions .btn {
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: none;
}
