:root {
  --a-ink: #17241d;
  --a-body: #55635c;
  --a-green: #b7724d;
  --a-green-2: #d67c4c;
  --a-sidebar: #eeeae7;
  --a-sidebar-hover: #b8724d;
  --a-sidebar-active: #f4f2f0;
  --a-line: rgb(23 36 29 / 4%);
  --a-bg: #f4f2f0;
  --a-white: #fff;
  --a-orange: #d9663c;
  --a-danger: #c0392b;
  --a-radius: 14px;
  --a-shadow: 0 4px 14px rgba(12, 40, 28, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--a-bg);
  color: var(--a-ink);
  font-size: 14px;
}

a { color: inherit; }

/* ---------------- shell ---------------- */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px; flex: none;
  background: var(--a-sidebar); color: var(--a-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.admin-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
}
.admin-brand img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.admin-brand span { font-weight: 700; font-size: 14px; color: var(--a-ink); line-height: 1.25; }
.admin-brand small { display: block; font-weight: 500; font-size: 10.5px; color: var(--a-body); }

.admin-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.admin-nav-label {
  padding: 14px 10px 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: #8f918d;
}
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; margin-bottom: 2px;
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  color: var(--a-ink);
}
.admin-nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.admin-nav a:hover { background: var(--a-sidebar-hover); color: #fff; }
.admin-nav a.active { background: var(--a-sidebar-active); color: var(--a-green); }
.admin-nav a.disabled { opacity: .45; cursor: default; }
.admin-nav a.disabled:hover { background: none; }

.admin-user {
  padding: 14px 18px; border-top: 1px solid var(--a-line);
  font-size: 12.5px;
}
.admin-user b { display: block; color: var(--a-ink); font-size: 13px; }
.admin-user a { color: var(--a-body); text-decoration: underline; }
.admin-user a:hover { color: var(--a-ink); }

/* ---------------- main ---------------- */
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--a-line);
}
.admin-topbar h1 { margin: 0; font-size: 27px; font-weight: 700; color: var(--a-green); }
.admin-topbar-left { display: flex; align-items: center; gap: 12px; }
.admin-topbar a.view-site { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--a-green); font-weight: 600; text-decoration: none; }
.admin-topbar a.view-site:hover { text-decoration: underline; }
.admin-topbar a.view-site svg { width: 14px; height: 14px; flex: none; }

.admin-content { padding: 26px 28px 60px; max-width: 960px; }

.admin-flash {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
  font-size: 13.5px; font-weight: 500;
}
.admin-flash.ok { background: #e5f3ea; color: #146b45; border: 1px solid #b8e0c6; }
.admin-flash.error { background: #fbeae7; color: var(--a-danger); border: 1px solid #f3c6be; }
.admin-flash.lang-notice { background: #fff6e8; color: #8a5a12; border: 1px solid #f2d9a8; }

.a-lang-switch { display: inline-flex; gap: 2px; margin-left: 4px; }
.a-lang-switch a {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: var(--a-body); text-decoration: none;
}
.a-lang-switch a:hover { background: var(--a-bg); }
.a-lang-switch a.is-active { background: var(--a-green); color: #fff; }

.admin-card {
  background: #fff; border: 1px solid var(--a-line); border-radius: var(--a-radius);
  padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--a-shadow);
}
.admin-card h2 { margin: 0 0 22px; font-size: 16px; }
.admin-card .hint { margin: 0 0 18px; font-size: 12.5px; color: var(--a-body); }
.admin-card .hint svg { width: 14px; height: 14px; vertical-align: -2px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.field .field-hint { display: block; font-size: 11.5px; color: var(--a-body); margin-top: 4px; }
.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--a-line); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; color: var(--a-ink); background: #fff;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--a-green-2); box-shadow: 0 0 0 3px rgba(35, 147, 95, .15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.logo-preview {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.logo-preview img {
  width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--a-line);
  border-radius: 10px; padding: 6px; background: #fafbfa;
}

/* Preview de la imagen en el formulario de Tours/Paquetes: mismo
   aspect-ratio 5/7 que la tarjeta real del sitio, a la mitad del ancho
   (~253px en el carrusel -> ~126px acá) para que no domine el form. */
.tour-preview {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 4px;
}
.tour-preview .thumb {
  width: 126px; aspect-ratio: 5 / 7; border-radius: 12px; overflow: hidden;
  flex: none; background: var(--a-bg); border: 1px solid var(--a-line);
}
.tour-preview .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tour-preview .field-file { flex: 1; padding-top: 4px; }

/* Foto de testimonios: circular (asi se ve en el sitio), recortada 1:1
   en el navegador antes de subirla — ver el cropper mas abajo. */
.t-photo-field { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.t-photo-current {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--a-bg); border: 1px solid var(--a-line); display: block;
}
.t-photo-current img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-avatar-mini {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.t-avatar-mini.tone-a { background: linear-gradient(135deg, #23935f, #a9812f); }
.t-avatar-mini.tone-b { background: linear-gradient(135deg, #8a9a3a, #a9812f); }
.t-avatar-mini.tone-c { background: linear-gradient(135deg, #d9663c, #23935f); }
.t-photo-file { flex: 1; padding-top: 2px; }

.t-cropper {
  margin: 12px 0 4px; padding: 16px; border: 1px solid var(--a-line);
  border-radius: var(--a-radius); background: var(--a-bg);
}
.t-crop-viewport {
  width: 240px; height: 240px; margin: 0 auto 14px; border-radius: 50%;
  overflow: hidden; position: relative; background: #000; cursor: grab;
  touch-action: none;
}
.t-crop-viewport.dragging { cursor: grabbing; }
.t-crop-viewport img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; }
#cropZoom { display: block; width: 240px; margin: 0 auto; }
.t-crop-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }

.a-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  background: var(--a-green); color: #fff;
}
.a-btn:hover { background: var(--a-green-2); }
.a-btn.secondary { background: #fff; color: var(--a-ink); border: 1px solid var(--a-line); }
.a-btn.secondary:hover { border-color: var(--a-green-2); }

.section-divider { margin: 26px 0 18px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--a-body); }

/* ---------------- listas (Tours / Paquetes / Testimonios) ---------------- */
.a-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.a-table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--a-body); padding: 0 10px 10px;
  border-bottom: 1px solid var(--a-line);
}
.a-table td { padding: 10px; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table .num-cell { font-variant-numeric: tabular-nums; color: var(--a-body); }

/* Grilla de tarjetas para Tours/Paquetes — reemplaza la tabla vieja.
   El contenido en si son fotos, asi que se ven como fotos, no como
   filas de datos. */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 150px);
  gap: 18px;
}
.item-card {
  display: flex; flex-direction: column; border: 1px solid var(--a-line);
  border-radius: 14px; overflow: hidden; background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.item-card:hover { box-shadow: var(--a-shadow); border-color: transparent; }
.item-card .thumb {
  position: relative; width: 100%; aspect-ratio: 5 / 7; background: var(--a-bg);
}
.item-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-card .thumb .pill { position: absolute; top: 8px; left: 8px; }
.item-card .thumb .tag-pill {
  position: absolute; top: 8px; right: 8px; background: rgba(10, 30, 20, .72); color: #fff;
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
.item-card .body { padding: 10px 11px 11px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.body-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.item-card .item-name { font-weight: 700; font-size: 13px; line-height: 1.3; }

/* Arrastrar para reordenar. touch-action:none es lo que deja que el
   gesto lo maneje el JS (Pointer Events) en vez de que el navegador lo
   interprete como scroll de la pagina en celular. */
.drag-handle {
  flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px;
  background: var(--a-bg); color: var(--a-body); display: grid; place-items: center;
  cursor: grab; touch-action: none;
}
.drag-handle:hover { background: var(--a-line); color: var(--a-ink); }
.drag-handle svg { width: 14px; height: 14px; }
.item-card.is-dragging { opacity: .45; }
.cards-grid.reordering { cursor: grabbing; }
.cards-grid.reordering .item-card:not(.is-dragging) { transition: transform .12s ease; }
.item-card .item-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--a-body); }
.item-card .item-meta .order { font-variant-numeric: tabular-nums; }
.item-card .item-actions {
  margin-top: auto; padding-top: 8px; border-top: 1px solid var(--a-line);
  display: flex; gap: 12px;
}
.a-row-actions { display: flex; gap: 12px; }
.a-row-actions a, .a-row-actions button,
.item-actions a, .item-actions button {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--a-green); text-decoration: none;
}
.a-row-actions .danger, .item-actions .danger { color: var(--a-danger); }
.a-row-actions a:hover, .a-row-actions button:hover,
.item-actions a:hover, .item-actions button:hover { text-decoration: underline; }
.item-actions form { display: contents; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.pill.on { background: #e5f3ea; color: #146b45; }
.pill.off { background: #f1f1ef; color: var(--a-body); }

.field select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--a-line); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; color: var(--a-ink); background: #fff;
}
.field-check { display: flex; align-items: center; gap: 8px; }
.field-check input { width: 16px; height: 16px; }
.field-check label { margin: 0; }

.a-empty { padding: 26px; text-align: center; color: var(--a-body); font-size: 13px; }

/* ---------------- modal ---------------- */
dialog.modal {
  border: 0; border-radius: var(--a-radius); padding: 0;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 50px rgba(12, 40, 28, .25);
}
dialog.modal::backdrop { background: rgba(12, 40, 28, .45); }
dialog.modal .modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--a-line);
}
dialog.modal .modal-head h2 { margin: 0; font-size: 15px; }
dialog.modal .modal-close {
  background: none; border: 0; cursor: pointer; color: var(--a-body);
  font-size: 22px; line-height: 1; padding: 0 2px;
}
dialog.modal .modal-close:hover { color: var(--a-ink); }
dialog.modal .modal-body { padding: 20px 22px 22px; }
dialog.modal .field:last-of-type { margin-bottom: 18px; }

/* ---------------- login ---------------- */
.login-shell {
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(12, 40, 28, .15), rgba(12, 40, 28, .25)),
    url('../../img/bg-mochilleando.jpg') center / cover no-repeat;
}
.login-card {
  width: 100%; max-width: 360px; background: #fff; border-radius: 20px;
  padding: 32px 28px; box-shadow: 0 20px 50px rgba(12, 40, 28, .35);
}
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-card .brand img { width: 46px; height: 46px; object-fit: contain; }
.login-card .brand-text { display: flex; flex-direction: column; gap: 4px; }
.login-card .brand-name {
  font-size: 17px; font-weight: 700; letter-spacing: .04em;
  color: #129051; text-transform: uppercase; line-height: 1;
}
.login-card .brand-name span { color: var(--a-orange); }
.login-card h1 { font-size: 16px; margin: 0 0 18px; }
.login-card .a-btn { width: 100%; justify-content: center; }

/* ---------------- mobile (celular) ---------------- */
.nav-toggle, .sidebar-backdrop { display: none; }

@media (max-width: 860px) {
  .admin-content { padding: 18px 16px 48px; }
  .admin-topbar { padding: 12px 16px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .admin-card { padding: 18px 16px; }

  /* El sidebar pasa a un cajon que entra desde la izquierda, igual que
     el menu mobile del sitio publico — mismo gesto, ya conocido. */
  .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.3);
  }
  .admin-sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(5, 20, 14, .45); z-index: 55;
  }
  .sidebar-backdrop.open { display: block; }

  .nav-toggle {
    display: grid; place-items: center; width: 38px; height: 38px; flex: none;
    border-radius: 10px; border: 1px solid var(--a-line); background: #fff; cursor: pointer;
  }
  .nav-toggle svg { width: 18px; height: 18px; }
  .admin-topbar a.view-site span { display: none; }
}

.placeholder-box {
  border: 1px dashed var(--a-line); border-radius: var(--a-radius);
  padding: 40px 20px; text-align: center; color: var(--a-body); font-size: 13.5px;
}
