/* Mis Anuncios — estilo ERP claro */
:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1a2332;
  --muted: #5a6b7d;
  --primary: #4293E1;
  --primary-soft: rgba(66, 147, 225, 0.12);
  --border: #d8e0ea;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.06);
  --ok: #128a4b;
  --bad: #c0392b;
  --warn: #b7791f;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.app-top-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand strong { display: block; font-size: 0.95rem; }
.brand small { color: var(--muted); font-size: 0.8rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: #f0c2c2; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 14px calc(100px + env(safe-area-inset-bottom));
}

.boot { padding: 40px 10px; text-align: center; color: var(--muted); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.page-head h1 {
  margin: 0;
  font-size: 1.35rem;
}
.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.publish-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.publish-bar select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  font-weight: 600;
  min-width: 200px;
  background: #fff;
}
.notice-card {
  background: #fff8e8;
  border-color: #f0d9a0;
}

.filter-bar { margin-bottom: 14px; }
.filter-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
@media (min-width: 640px) {
  .filter-row {
    grid-template-columns: 1fr 160px auto;
    align-items: center;
  }
}
.filter-search input,
#filter-plan {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.filter-search input:focus,
#filter-plan:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.group-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.group-btn em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  background: #eef2f7;
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 1.4em;
  text-align: center;
}
.group-btn:hover {
  border-color: #93c5fd;
  color: #1d4f8c;
  background: #f0f7ff;
}
.group-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.group-btn.active em {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.filter-meta {
  margin: 10px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
@media (max-width: 640px) {
  .listing-card {
    grid-template-columns: 64px 1fr;
  }
  .listing-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }
  .listing-actions .btn { flex: 1; }
}

.listing-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
}
.listing-cover {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: #e8eef5 center/cover no-repeat;
  border: 1px solid var(--border);
  overflow: hidden;
}
.listing-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listing-card h3 { margin: 0 0 4px; font-size: 1rem; }
.listing-card .meta { color: var(--muted); font-size: 0.85rem; }
.listing-actions { display: flex; flex-direction: column; gap: 6px; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #eef2f7;
  color: var(--muted);
}
.badge-free { background: #eef2f7; }
.badge-paid { background: #e6f4ea; color: var(--ok); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input,
.form-grid select,
.form-grid textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.form-grid textarea { min-height: 90px; resize: vertical; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }

.pricing-box {
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: linear-gradient(180deg, #f0f7ff, #fff);
  padding: 12px;
  margin: 0;
}
.pricing-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.pricing-head strong {
  font-size: 0.95rem;
  color: #1d4f8c;
}
.pricing-toggle {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}
.pricing-toggle input { width: auto; accent-color: var(--primary); }
.pricing-fields { margin: 0; }

.plan-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.plan-tabs button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.plan-tabs button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: #1a4a7a;
}

.paywall {
  background: #fff8e8;
  border: 1px solid #f0d9a0;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  font-size: 0.9rem;
}
.paywall a { color: var(--ok); font-weight: 700; }

.cover-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hours-editor { display: grid; gap: 8px; }
.hours-times, .hours-days { display: flex; flex-wrap: wrap; gap: 8px; }
.hours-day { display: inline-flex; align-items: center; gap: 4px; font-size: 0.88rem; }
.cover-preview {
  width: 160px;
  height: 160px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: #e8eef5 center/cover no-repeat;
  border: 1px solid var(--border);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.gallery-grid .g-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-grid button.g-del {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 10px;
}

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  text-align: center;
  z-index: 30;
}
.bottom-nav a { color: var(--primary); font-weight: 700; text-decoration: none; }
.foot-copy { margin: 4px 0 0; font-size: 0.75rem; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: #1a2332;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  z-index: 80;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--bad); }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .listing-card { grid-template-columns: 64px 1fr; }
  .listing-actions { grid-column: 1 / -1; flex-direction: row; }
}
