:root {
  --brand: #ffb000;
  --brand-strong: #d99000;
  --ink: #252525;
  --muted: #66707a;
  --line: #e5e7eb;
  --soft: #f8f5ed;
  --paper: #ffffff;
  --green: #16845f;
  --red: #c94848;
  --shadow: 0 18px 42px rgba(28, 31, 36, .12);
}

* {
  box-sizing: border-box;
}

[hidden] { display: none !important; }

.demo-label { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.listing-dialog { width: min(540px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 12px; padding: 24px; color: var(--ink); }
.listing-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.listing-dialog p { line-height: 1.5; }
.listing-dialog .primary-button { margin-top: 16px; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 176, 0, .18), transparent 34rem),
    var(--soft);
}

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

button {
  border: 0;
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  width: min(1220px, calc(100% - 28px));
  min-height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
  text-decoration: none;
}

.brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff3cc;
  box-shadow: 0 8px 22px rgba(217, 144, 0, .22), inset 0 0 0 1px rgba(217, 144, 0, .22);
}

.brand__mark img {
  width: 31px;
  height: 31px;
}

.topbar__tools {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.login-bar,
.session-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.login-bar input,
.login-bar select {
  width: 132px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 14px;
}

.login-bar button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.login-bar a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.login-bar a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.login-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.session-bar {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.session-bar .soft-button {
  min-height: 36px;
}

.shell {
  width: min(1220px, calc(100% - 28px));
  margin: 22px auto 44px;
}

.workspace {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

.control-panel,
.panel,
.listing-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(28, 31, 36, .08);
}

.control-panel {
  position: sticky;
  top: 96px;
  padding: 20px;
  display: grid;
  gap: 18px;
  border-color: rgba(217, 144, 0, .28);
  box-shadow: 0 12px 32px rgba(217, 144, 0, .12);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 56px;
  line-height: .95;
  letter-spacing: 0;
}

.lede {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.language-switcher {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.language-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.language-button img {
  width: 22px;
  height: 15px;
  display: block;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}

.language-button.is-active {
  border-color: var(--brand);
  background: #fff7e1;
  color: var(--ink);
}

.search-box,
.listing-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 176, 0, .2);
}

.filter-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.filter,
.soft-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.filter.is-active,
.soft-button:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #202020;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stats div {
  padding: 12px;
  border-radius: 8px;
  background: #f7f0df;
}

.stats strong {
  display: block;
  font-size: 22px;
}

.stats span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.results {
  min-width: 0;
}

.results__head,
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel__head {
  margin: 0;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.results__head h2,
.panel h2 {
  margin: 0;
  font-size: 22px;
}

.results__head p,
.panel__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.listing-card {
  overflow: hidden;
}

.listing-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  background: #ddd;
}

.listing-card__body {
  padding: 15px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.listing-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf7f3;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.meta {
  margin: 9px 0 14px;
  color: var(--muted);
  line-height: 1.4;
  font-size: 14px;
}

.price-list {
  display: grid;
  gap: 6px;
}

.price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-weight: 900;
  font-size: 23px;
}

.price--small {
  font-size: 17px;
}

.price span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.price__label {
  min-width: 58px;
  color: var(--ink) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  margin-top: 14px;
}

.primary-button {
  min-height: 46px;
  padding: 0 15px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.whatsapp-button {
  height: 44px;
  border-radius: 8px;
  background: var(--brand);
  color: #202020;
  font-weight: 900;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.admin-view {
  display: block;
}

.admin-grid {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 18px;
  align-items: start;
}

.listing-form {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.listing-form .primary-button {
  background: var(--brand);
  color: #202020;
}

.notice {
  margin: 16px;
  padding: 12px 14px;
  border: 1px solid #ffe0a3;
  border-radius: 8px;
  background: #fff7e6;
  color: #744b00;
  font-weight: 700;
  line-height: 1.4;
}

.admin-list {
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric-card {
  min-height: 138px;
  padding: 14px;
  border: 1px solid rgba(217, 144, 0, .22);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf0, #fff);
  box-shadow: 0 10px 24px rgba(217, 144, 0, .1);
}

.metric-card strong {
  display: block;
  font-size: 26px;
}

.metric-card span {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.metric-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.activity-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.activity-list p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.activity-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.owned-listings {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-row img {
  width: 84px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
}

.admin-row h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

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

.delete-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fff1f1;
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 1040px) {
  .workspace,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }
}

@media (max-width: 780px) {
  .topbar { position: static; }
  .topbar__inner {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .topbar__tools,
  .language-switcher,
  .login-bar,
  .session-bar {
    width: 100%;
    justify-items: stretch;
    justify-content: stretch;
  }

  .language-button {
    flex: 1 1 136px;
  }

  .login-bar input,
  .login-bar select {
    flex: 1 1 140px;
    width: auto;
  }

  h1 {
    font-size: 42px;
  }

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

  .results__head,
  .panel__head {
    align-items: stretch;
    flex-direction: column;
  }

  .two-col,
  .stats,
  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .admin-row {
    grid-template-columns: 72px 1fr auto;
  }

  .admin-row img {
    width: 72px;
    height: 58px;
  }
}
