/* ============================================================================
   admin.css — Estilos del panel CMS.
   ============================================================================ */

/* --------- Login --------- */
.form-label {
  display: block;
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, 0.6);
  margin-bottom: .5rem;
  font-weight: 600;
}
.form-input-wrap {
  display: flex; align-items: center; gap: .65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: .85rem 1rem;
  transition: border-color .25s ease, background .25s ease;
}
.form-input-wrap:focus-within { border-color: rgba(230, 203, 139, .7); background: rgba(255, 255, 255, .07); }
.form-input {
  flex: 1; background: transparent; color: var(--cream, #FAF7F2);
  font-size: .95rem; outline: none; border: 0;
}
.form-input::placeholder { color: rgba(250, 247, 242, .35); }
.form-eye { color: rgba(250, 247, 242, .5); transition: color .2s ease; }
.form-eye:hover { color: var(--gold-2, #E6CB8B); }

.btn-gold-full {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .85rem 1.4rem;
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600;
  background: #B7913E; color: #fff;
  border-radius: 9999px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), background .25s ease, box-shadow .3s ease;
  box-shadow: 0 10px 28px -10px rgba(183, 145, 62, .55);
}
.btn-gold-full:hover { transform: translateY(-1px); background: #a07c30; }
.btn-gold-full:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-outline {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .95rem;
  font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600;
  background: transparent;
  color: #1B1F3B;
  border: 1px solid #E7E1D6;
  border-radius: 9999px;
  transition: border-color .25s ease, color .25s ease, background .25s ease;
}
.btn-outline:hover { border-color: #B7913E; color: #B7913E; }

.btn-danger {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .95rem;
  font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600;
  background: transparent;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, .25);
  border-radius: 9999px;
  transition: background .25s ease, color .25s ease;
}
.btn-danger:hover { background: rgba(185, 28, 28, .08); }

/* --------- Noise overlay (reutilizado del frontend público) --------- */
.noise-overlay {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* --------- Tabs --------- */
.cms-tab {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: 1rem 1.2rem;
  font-size: .85rem;
  font-weight: 500;
  color: #5D6478;
  border-bottom: 2px solid transparent;
  transition: color .25s ease, border-color .25s ease;
}
.cms-tab:hover { color: #1B1F3B; }
.cms-tab.active {
  color: #1B1F3B;
  border-bottom-color: #B7913E;
  font-weight: 600;
}

.section-eyebrow {
  font-size: .7rem; letter-spacing: .35em; text-transform: uppercase; font-weight: 600;
}

/* --------- Language pill (content tab) --------- */
.lang-pill {
  padding: .4rem .9rem;
  font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 600;
  border-radius: 9999px;
  color: #5D6478;
  transition: background .25s ease, color .25s ease;
}
.lang-pill:hover { color: #1B1F3B; }
.lang-pill.active { background: #1B1F3B; color: #FAF7F2; }

/* --------- Content groups --------- */
.content-group {
  background: #fff;
  border: 1px solid #E7E1D6;
  border-radius: 18px;
  overflow: hidden;
}
.content-group-head {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.4rem;
  background: rgba(231, 225, 214, .35);
  border-bottom: 1px solid #E7E1D6;
}
.content-group-head h3 {
  font-family: "Fraunces", serif; font-size: 1.25rem; font-weight: 500;
  text-transform: capitalize; color: #1B1F3B;
}
.content-group-head .badge {
  margin-left: auto;
  font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; font-weight: 600;
  color: #B7913E;
  background: rgba(183, 145, 62, .1);
  border-radius: 9999px;
  padding: .25rem .65rem;
}
.content-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .9rem 1.4rem;
  border-top: 1px solid #F1ECE2;
  transition: background .25s ease;
}
.content-row:first-of-type { border-top: 0; }
.content-row:hover { background: rgba(250, 247, 242, .6); }
.content-row .key {
  font-family: monospace;
  font-size: .78rem;
  color: #5D6478;
}
.content-row .value-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .5rem .65rem;
  font-size: .95rem;
  color: #1B1F3B;
  transition: border-color .2s ease, background .2s ease;
  font-family: inherit;
  resize: vertical;
  min-height: 38px;
}
.content-row .value-input:hover { border-color: #E7E1D6; }
.content-row .value-input:focus { border-color: #B7913E; background: #fff; outline: none; }

.content-row .save-state {
  font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600;
  color: transparent;
  transition: color .25s ease;
}
.content-row .save-state.saving { color: #5D6478; }
.content-row .save-state.saved  { color: #16a34a; }
.content-row .save-state.error  { color: #b91c1c; }

/* --------- Table --------- */
.cms-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cms-table thead th {
  text-align: left;
  font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; font-weight: 700;
  color: #5D6478;
  padding: .9rem 1.2rem;
  background: rgba(231, 225, 214, .35);
  border-bottom: 1px solid #E7E1D6;
}
.cms-table tbody td {
  padding: .95rem 1.2rem;
  border-top: 1px solid #F1ECE2;
  vertical-align: middle;
  color: #1B1F3B;
}
.cms-table tbody tr:hover { background: rgba(250, 247, 242, .55); }
.cms-table .row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: #5D6478;
  transition: background .2s ease, color .2s ease;
}
.icon-btn:hover { background: rgba(231, 225, 214, .55); color: #1B1F3B; }
.icon-btn.danger:hover { background: rgba(185, 28, 28, .08); color: #b91c1c; }

.badge-pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .55rem;
  border-radius: 9999px;
  font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 700;
}
.badge-pill.on  { background: rgba(22, 163, 74, .1);  color: #15803d; }
.badge-pill.off { background: rgba(120, 113, 108, .12); color: #57534e; }
.badge-pill.usa  { background: rgba(183, 145, 62, .1);  color: #B7913E; }
.badge-pill.py   { background: rgba(230, 57, 70, .1);  color: #E63946; }

/* --------- Tier cards admin --------- */
.tier-admin {
  position: relative;
  background: #fff;
  border: 1px solid #E7E1D6;
  border-radius: 18px;
  padding: 1.5rem 1.6rem 1.6rem;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.tier-admin:hover { border-color: #B7913E; box-shadow: 0 18px 40px -20px rgba(15, 23, 42, .18); }
.tier-admin.featured { border-color: #B7913E; background: linear-gradient(180deg, rgba(183,145,62,.06), #fff); }
.tier-admin.featured::before {
  content: "★ Featured";
  position: absolute; top: 14px; right: 14px;
  font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700;
  background: #B7913E; color: #fff;
  border-radius: 9999px;
  padding: .22rem .6rem;
}
.tier-admin h4 {
  font-family: "Fraunces", serif; font-weight: 500;
  font-size: 1.35rem; color: #1B1F3B; letter-spacing: -.01em;
}
.tier-admin .price {
  font-family: "Fraunces", serif;
  font-weight: 500; font-size: 2rem; color: #1B1F3B;
  margin-top: .55rem;
}
.tier-admin .slug {
  font-family: monospace; font-size: .7rem;
  color: #5D6478; margin-top: .1rem;
}
.tier-admin .meta {
  display: flex; flex-wrap: wrap; gap: .35rem;
  margin-top: 1rem; font-size: .68rem;
  letter-spacing: .15em; text-transform: uppercase; font-weight: 600;
  color: #5D6478;
}
.tier-admin ul.benefits {
  margin-top: 1rem; display: flex; flex-direction: column; gap: .4rem;
}
.tier-admin ul.benefits li {
  display: flex; gap: .5rem; align-items: flex-start;
  font-size: .85rem; color: #5D6478; font-weight: 400;
  line-height: 1.4;
}
.tier-admin ul.benefits li svg { color: #B7913E; flex-shrink: 0; margin-top: 2px; }
.tier-admin .actions {
  display: flex; gap: .4rem; margin-top: 1.4rem;
  padding-top: 1.2rem; border-top: 1px solid #F1ECE2;
}

/* --------- Modal --------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: min(720px, 92vw);
  max-height: 90vh;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 50px 100px -20px rgba(15, 23, 42, .35);
  overflow: hidden;
  animation: modalIn .3s cubic-bezier(.2, .8, .2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.6rem;
  border-bottom: 1px solid #E7E1D6;
}
.modal-close {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: #5D6478;
  transition: background .2s ease, color .2s ease;
}
.modal-close:hover { background: rgba(231, 225, 214, .55); color: #1B1F3B; }
.modal-body {
  padding: 1.4rem 1.6rem;
  overflow-y: auto;
}
.modal-footer {
  display: flex; gap: .55rem; justify-content: flex-end;
  padding: 1rem 1.6rem;
  background: rgba(250, 247, 242, .6);
  border-top: 1px solid #E7E1D6;
}

/* Field group inside modal */
.field {
  display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem;
}
.field > label {
  font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; font-weight: 700;
  color: #5D6478;
}
.field > input[type="text"],
.field > input[type="url"],
.field > input[type="number"],
.field > textarea,
.field > select {
  border: 1px solid #E7E1D6;
  background: #fff;
  border-radius: 10px;
  padding: .7rem .85rem;
  font-size: .92rem;
  color: #1B1F3B;
  outline: none;
  transition: border-color .25s ease;
  font-family: inherit;
}
.field > textarea { resize: vertical; min-height: 90px; }
.field > input:focus,
.field > textarea:focus,
.field > select:focus { border-color: #B7913E; }

/* Tabs language inside modal */
.modal-lang-tabs {
  display: flex; gap: .35rem;
  background: rgba(231, 225, 214, .55);
  padding: .25rem; border-radius: 9999px;
  width: max-content; margin-bottom: 1rem;
}
.modal-lang-tab {
  padding: .35rem .9rem;
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700;
  color: #5D6478;
  border-radius: 9999px;
  transition: background .2s ease, color .2s ease;
}
.modal-lang-tab.active { background: #1B1F3B; color: #FAF7F2; }

.modal-lang-pane.hidden { display: none; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.switch {
  position: relative; display: inline-flex; align-items: center; gap: .6rem;
  cursor: pointer; user-select: none;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 38px; height: 22px;
  background: #E7E1D6;
  border-radius: 9999px;
  position: relative;
  transition: background .25s ease;
}
.switch .track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .25s ease;
}
.switch input:checked + .track { background: #B7913E; }
.switch input:checked + .track::after { transform: translateX(16px); }

/* --------- Toast --------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; align-items: center; gap: .6rem;
  background: #1B1F3B; color: #FAF7F2;
  border-radius: 12px;
  padding: .8rem 1.1rem;
  font-size: .88rem; font-weight: 500;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, .45);
  animation: toastIn .35s cubic-bezier(.2,.8,.2,1);
}
.toast.error { background: #7f1d1d; }
.toast.error svg { color: #fecaca; }
.toast svg { color: #E6CB8B; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* --------- Skeletons / loaders --------- */
.loading-skel {
  height: 180px;
  background: linear-gradient(90deg, #fff 0%, rgba(231,225,214,.7) 50%, #fff 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 16px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------- Auto-translate styling --------- */
.key-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}
.btn-translate {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #B7913E;
  background: rgba(183, 145, 62, 0.06);
  border: 1px solid rgba(183, 145, 62, 0.15);
  border-radius: 6px;
  cursor: pointer;
  width: max-content;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-translate:hover {
  background: #B7913E;
  color: #fff;
}
.btn-translate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.badge-pill.neutral { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
