/* =====================================================
   EntreDosLagunas Admin v4 — Panel editorial elegante
   Paleta: cream + azul atlántico · responsive completo
   ===================================================== */

/* ══ Material Symbols Rounded ══════════════════════════════ */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded' !important;
  font-weight: normal !important;
  font-style: normal !important;
  font-size: 20px !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  display: inline-block !important;
  white-space: nowrap !important;
  word-wrap: normal !important;
  direction: ltr !important;
  -webkit-font-feature-settings: 'liga' !important;
  -webkit-font-smoothing: antialiased !important;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24 !important;
  user-select: none;
  vertical-align: middle;
}
.sidebar__link.is-active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24 !important;
}
.sidebar__icon {
  width: 22px;
  height: 22px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}



:root {
  --cream:       #f5f1e8;
  --cream-2:     #ede8db;
  --cream-3:     #e3dccb;
  --paper:       #fbf8f1;
  --olive:       #1a3050;
  --olive-2:     #1e3d63;
  --olive-soft:  #3d6490;
  --olive-dust:  #8aaec8;
  --ink:         #0f1e30;
  --ink-soft:    #2c4a6a;
  --muted:       #7a95aa;
  --line:        #ccd8e0;
  --line-2:      #b8cad6;
  --accent:      #c97f4a;
  --accent-soft: #e3a878;
  --honey:       #d4a847;

  --danger:      #b94a3e;
  --success:     #5e7d3a;
  --warning:     #b8852d;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --sh-sm: 0 4px 16px rgba(45,58,31,.06);
  --sh-md: 0 12px 32px rgba(45,58,31,.08);

  --ease: cubic-bezier(.4,.0,.2,1);
  --dur: 240ms;

  --sidebar-w: 240px;
  --topbar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
h1,h2,h3,h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; color: var(--olive); }
p { margin: 0 0 .8em; }
::selection { background: var(--olive); color: var(--cream); }

/* ---------- LOGIN ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 100% 0%, var(--cream-2), transparent 60%),
    radial-gradient(600px 300px at 0% 100%, var(--accent-soft), transparent 60%),
    var(--cream);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px 36px 36px;
  box-shadow: var(--sh-md);
}
@media (max-width: 480px) {
  .login-card { padding: 28px 20px 24px; border-radius: 16px; }
}

.logo__img {
  height: 65px;
  width: auto;
  object-fit: contain;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo__mark {
  display: flex;
  align-items: center;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.login-logo-mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--olive);
  color: var(--cream);
  display: grid; place-items: center;
}
.login-logo-mark svg { width: 18px; height: 18px; }
.login-logo span {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.025em;
  color: var(--olive);
}
.login-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.login-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--olive-soft); }
.login-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

/* ---------- FIELDS ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
  /* Fix mobile zoom */
  font-size: max(16px, 14.5px);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 0;
  border-color: var(--olive);
  background: var(--paper);
}
.field textarea { resize: vertical; min-height: 100px; font-family: inherit; font-size: 14.5px !important; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8b6d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* Grid 2 columnas → 1 en mobile */
.field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 680px) {
  .field--row { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--olive);
  color: var(--cream);
  border-radius: 999px;
  font-weight: 600;
  font-size: 13.5px;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
  border: 1px solid var(--olive);
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px; /* touch target mínimo */
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn--full { width: 100%; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--cream-2); border-color: var(--olive); color: var(--olive); }
.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(185,74,62,.3);
}
.btn--danger:hover { background: var(--danger); color: var(--cream); border-color: var(--danger); }
.btn--sm { padding: 7px 14px; font-size: 12.5px; min-height: 36px; }

.login-help {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.login-help a { color: var(--olive); font-weight: 600; }

/* ---------- ALERTS ---------- */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  font-weight: 500;
}
.alert--error   { background: rgba(185,74,62,.08); color: var(--danger); border-color: rgba(185,74,62,.18); }
.alert--success { background: rgba(94,125,58,.10); color: var(--success); border-color: rgba(94,125,58,.22); }
.alert--info    { background: var(--cream-2); color: var(--ink-soft); border-color: var(--line); }

/* ---------- SHELL (sidebar + main) ---------- */
.admin-shell { display: flex; min-height: 100vh; }

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--olive);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 30;
  overflow-y: auto;
  overflow-x: hidden;
  /* scroll suave para sidebar larga */
  overscroll-behavior: contain;
}
/* Scrollbar delgada en sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(245,241,232,.2); border-radius: 4px; }

.sidebar__brand {
  padding: 20px 20px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(245,241,232,.1);
  flex-shrink: 0;
}
.sidebar__brand-mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--olive);
  display: grid; place-items: center;
}
.sidebar__brand-mark svg { width: 17px; height: 17px; }
.sidebar__brand span {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.02em;
  color: var(--cream);
}
.sidebar__brand em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--olive-dust); }

.sidebar__section {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--olive-dust);
  padding: 20px 22px 8px;
  flex-shrink: 0;
}
.sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  gap: 2px;
  flex: 1;
  padding-bottom: 8px;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(245,241,232,.78);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.sidebar__link:hover { background: rgba(245,241,232,.07); color: var(--cream); }
.sidebar__link.is-active { background: var(--cream); color: var(--olive); font-weight: 600; }
.sidebar__icon {
  width: 22px; height: 22px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: inherit !important;
}

.sidebar__bottom {
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(245,241,232,.1);
  flex-shrink: 0;
  /* Asegura que se vea siempre */
  background: var(--olive);
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: rgba(245,241,232,.7);
}
.sidebar__user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  display: grid; place-items: center;
  color: var(--cream);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar__user strong { color: var(--cream); display: block; font-size: 13px; font-weight: 600; }
.sidebar__user span { font-size: 11.5px; word-break: break-all; }
.sidebar__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  font-size: 13px;
  color: var(--olive-dust);
  border: 1px solid rgba(245,241,232,.18);
  border-radius: 999px;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.sidebar__logout:hover { background: rgba(245,241,232,.1); color: var(--cream); border-color: rgba(245,241,232,.4); }

/* ---------- MOBILE BAR ---------- */
.mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 25;
  gap: 12px;
}
.mobile-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.02em;
  color: var(--olive);
  min-width: 0;
}
.mobile-bar__brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-bar__brand-mark {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--olive);
  color: var(--cream);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.mobile-bar__brand-mark svg { width: 16px; height: 16px; }
.mobile-bar__toggle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--olive);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-bar__toggle span {
  width: 17px; height: 2px; background: currentColor; border-radius: 2px;
  display: block;
  transition: all .2s ease;
}

/* ---------- RESPONSIVE: MOBILE SIDEBAR ---------- */
@media (max-width: 900px) {
  .mobile-bar { display: flex; }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--topbar-h));
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    box-shadow: 8px 0 40px rgba(45,58,31,.22);
    /* Flex column: nav hace scroll, bottom siempre visible */
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar.is-open { transform: translateX(0); }

  /* El nav dentro del sidebar hace scroll independiente */
  .sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 8px;
  }

  /* El bottom siempre pegado al fondo, nunca se corta */
  .sidebar__bottom {
    flex-shrink: 0;
    overflow: visible;
    padding: 16px 20px max(40px, env(safe-area-inset-bottom, 40px));
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--topbar-h);
    left: 0; right: 0; bottom: 0;
    background: rgba(45,58,31,.45);
    z-index: 28;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .sidebar-overlay.is-visible { display: block; }

  /* Sidebar oculta en desktop breakpoint */
  .admin-shell { display: block; }
}

/* ---------- MAIN ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px;
}
@media (max-width: 900px) {
  .main { padding: 20px 16px 32px; }
}
@media (max-width: 480px) {
  .main { padding: 16px 14px 28px; }
}

/* ---------- PAGE HEAD ---------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-head__title {
  font-size: clamp(22px, 5vw, 38px);
  font-weight: 600;
  letter-spacing: -.025em;
  margin: 0;
  line-height: 1.15;
}
.page-head__title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--olive-soft); }
.page-head__sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}
@media (max-width: 560px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head .btn { width: 100%; }
}

/* ---------- DASHBOARD STATS ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.stat-card:hover { border-color: var(--olive-soft); background: var(--cream); }
.stat-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-card__icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--olive);
  display: grid; place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.stat-card__value {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 700;
  color: var(--olive);
  letter-spacing: -.025em;
  line-height: 1;
}
.stat-card__foot {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 8px;
  font-weight: 500;
}
.stat-card--accent {
  background: var(--olive);
  color: var(--cream);
  border-color: var(--olive);
}
.stat-card--accent .stat-card__label { color: var(--olive-dust); }
.stat-card--accent .stat-card__value { color: var(--cream); }
.stat-card--accent .stat-card__foot { color: rgba(245,241,232,.7); }
.stat-card--accent .stat-card__icon { background: rgba(245,241,232,.12); color: var(--cream); }

/* ---------- CARD GENÉRICA ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -.015em;
}

/* ---------- TOOLBAR ---------- */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar__count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-right: auto;
  white-space: nowrap;
}
.toolbar__search {
  display: inline-flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 3px 3px 14px;
  transition: border-color var(--dur) var(--ease);
  min-width: 0;
}
.toolbar__search:focus-within { border-color: var(--olive); }
.toolbar__search input {
  border: 0; outline: 0; background: transparent;
  font-size: 14px;
  padding: 7px 0;
  width: min(200px, 100%);
  min-width: 80px;
  /* Evitar zoom en iOS */
  font-size: max(16px, 14px);
}
.toolbar__search button {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--olive);
  color: var(--cream);
  display: grid; place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .toolbar { gap: 8px; }
  .toolbar__search { flex: 1; }
  .toolbar__search input { width: 100%; }
}

/* ---------- TABLA ---------- */
.table-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 13px 16px;
  text-align: left;
  font-size: 13.5px;
  vertical-align: middle;
}
.table th {
  background: var(--cream-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tr + tr td { border-top: 1px solid var(--line); }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: var(--cream); }
.table strong { color: var(--olive); font-weight: 600; }
.table .table__title {
  font-weight: 600;
  color: var(--olive);
  font-size: 14px;
  margin: 0 0 2px;
  letter-spacing: -.012em;
}
.table .table__sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.table-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Mobile: cards en lugar de tabla */
@media (max-width: 760px) {
  .table-wrap { border-radius: var(--r-md); overflow: visible; background: transparent; border: none; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    margin-bottom: 10px;
    padding: 14px 16px;
    box-shadow: var(--sh-sm);
  }
  .table tr + tr td { border-top: 0; }
  .table td {
    padding: 5px 0;
    border: 0;
    text-align: left;
  }
  .table td::before {
    content: attr(data-label) ' · ';
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .12em;
    text-transform: uppercase;
    display: inline;
    margin-right: 4px;
  }
  .table td:not([data-label])::before { display: none; }
  .table-actions {
    justify-content: flex-start;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    margin-top: 8px;
    gap: 8px;
  }
  .table-actions .btn--sm {
    flex: 1;
    justify-content: center;
    min-height: 40px;
  }
}

/* ---------- BADGE / TAG ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--cream-2);
  color: var(--ink-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge--ok      { background: rgba(94,125,58,.12); color: var(--success); }
.badge--off     { background: rgba(185,74,62,.10); color: var(--danger); }
.badge--draft   { background: rgba(184,133,45,.12); color: var(--warning); }
.badge--feat    { background: var(--olive); color: var(--cream); }

/* ---------- FORM CONTAINER ---------- */
.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  max-width: 880px;
  width: 100%;
}
@media (max-width: 680px) { .form-card { padding: 18px 16px; border-radius: var(--r-md); } }
@media (max-width: 420px) { .form-card { padding: 16px 14px; } }

.form-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.form-section:first-child { padding-top: 0; }
.form-section:last-child { border-bottom: 0; padding-bottom: 0; }

.form-section__title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
}

.help-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
  line-height: 1.45;
}

/* Image preview */
.img-preview-wrap {
  margin-top: 10px;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  background: var(--cream-2);
  overflow: hidden;
  position: relative;
  border: 1.5px dashed var(--line);
  cursor: pointer;
  transition: border-color .2s;
}
.img-preview-wrap:hover { border-color: var(--olive); }
.img-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.img-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.img-preview-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,.52);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 3px 9px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.img-preview-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .18s;
  user-select: none;
}
.img-preview-btn:hover { background: rgba(0,0,0,.75); }
@media (max-width: 600px) {
  .img-preview-wrap { max-width: 100%; aspect-ratio: 4/3; }
  .img-preview-btn { font-size: 11px; padding: 5px 11px; }
}

/* Switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 42px; height: 26px;
  background: var(--cream-3);
  border-radius: 999px;
  position: relative;
  transition: background var(--dur) var(--ease);
  flex-shrink: 0;
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 18px; height: 18px;
  background: var(--paper);
  border-radius: 50%;
  transition: transform var(--dur) var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.switch input:checked + .switch__track { background: var(--olive); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch__label { font-size: 13.5px; font-weight: 500; line-height: 1.4; }

/* ---------- SEG-CTRL (selector de estado) ---------- */
.seg-ctrl {
  display: flex;
  flex-wrap: wrap;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--cream);
  margin-top: 2px;
}
.seg-ctrl__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  border-right: 1px solid var(--line);
  user-select: none;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.seg-ctrl__opt:last-child { border-right: 0; }
.seg-ctrl__opt input[type="radio"] { display: none; }
.seg-ctrl__opt svg { flex-shrink: 0; opacity: .7; }
.seg-ctrl__opt:hover {
  background: var(--cream-2);
  color: var(--olive);
}
.seg-ctrl__opt:hover svg { opacity: 1; }
.seg-ctrl__opt.is-on,
.seg-ctrl__opt:has(input:checked) {
  background: var(--olive);
  color: var(--cream);
  font-weight: 600;
}
.seg-ctrl__opt.is-on svg,
.seg-ctrl__opt:has(input:checked) svg { opacity: 1; }

/* Variante warn (nivel medio) */
.seg-ctrl__opt--warn.is-on,
.seg-ctrl__opt--warn:has(input:checked) {
  background: var(--accent);
  color: var(--cream);
}
/* Variante crit (nivel crítico) */
.seg-ctrl__opt--crit.is-on,
.seg-ctrl__opt--crit:has(input:checked) {
  background: #9b2c1e;
  color: #fff;
}

/* En mobile, seg-ctrl apila verticalmente si son más de 2 opts */
@media (max-width: 480px) {
  .seg-ctrl { flex-direction: column; }
  .seg-ctrl__opt {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex: none;
    width: 100%;
    justify-content: flex-start;
  }
  .seg-ctrl__opt:last-child { border-bottom: 0; }
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}
.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}
.empty-state p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* ── Data table ─────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--cream-2);
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--cream-2); }
/* ── data-table responsive móvil ───────────── */
@media (max-width: 680px) {
  /* Wrapper scrollable horizontal para tablas en general */
  .card > .data-table,
  .card > div > .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Tabla usuarios: cards en móvil (< 640px) */
@media (max-width: 640px) {
  .usuarios-table { display: block; }
  .usuarios-table thead { display: none; }
  .usuarios-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  /* Cada fila se convierte en una card */
  .usuarios-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--paper);
    border-bottom: 1px solid var(--line) !important;
  }

  /* Todas las celdas visibles y apiladas */
  .usuarios-table tbody td {
    display: flex !important;
    align-items: center;
    border: none !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 10px 14px !important;
    font-size: 13px;
  }
  .usuarios-table tbody td:last-child {
    border-bottom: none !important;
  }

  /* Fila 1: nombre + avatar — sin label */
  .usuarios-table tbody td:nth-child(1) {
    background: var(--cream-2);
    padding: 12px 14px !important;
  }

  /* Filas con label a la izquierda */
  .usuarios-table tbody td:nth-child(2)::before { content: 'Email'; }
  .usuarios-table tbody td:nth-child(3)::before { content: 'Rol'; }
  .usuarios-table tbody td:nth-child(4)::before { content: 'Estado'; }
  .usuarios-table tbody td:nth-child(5)::before { content: 'Creado'; }

  .usuarios-table tbody td:nth-child(2)::before,
  .usuarios-table tbody td:nth-child(3)::before,
  .usuarios-table tbody td:nth-child(4)::before,
  .usuarios-table tbody td:nth-child(5)::before {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    min-width: 60px;
    flex-shrink: 0;
    margin-right: 8px;
  }

  /* Fila de acciones: botones en fila */
  .usuarios-table tbody td:nth-child(6) {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px !important;
    background: var(--cream-2);
  }

  .usuarios-table .btn--sm {
    font-size: 11.5px;
    padding: 5px 10px;
    min-height: 32px;
    white-space: nowrap;
  }
}


/* ── Alerta banner (front-end) ───────────── */
.alerta-banner {
  position: relative;
  z-index: 60;
}
.alerta-banner a { text-decoration: none; }
.alerta-banner a:hover { text-decoration: underline; }

/* ── Utilidades extra ───────────────────── */
/* Para que datetime-local no se corte en mobile */
input[type="datetime-local"] {
  width: 100%;
  min-width: 0;
}

/* File input más amigable */
input[type="file"] {
  font-size: 13.5px;
  padding: 8px 10px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 100%;
  cursor: pointer;
}
input[type="file"]::-webkit-file-upload-button {
  background: var(--olive);
  color: var(--cream);
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
  font-family: inherit;
}

/* ── Filtros de galería ─────────────────── */
.filter-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── Fix: campo de fecha programada en mobile ────── */
@media (max-width: 680px) {
  #fieldPublishAt {
    margin-top: 4px;
  }
}

/* ── Fix: switch en field--row mobile ────────────── */
@media (max-width: 680px) {
  .field .switch { margin-top: 0 !important; }
}


/* ── Fix: filtros galería con pill buttons ────────── */
.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-row .btn--sm {
  flex-shrink: 0;
}


/* ================================================================
   Configuración — Color principal
   ================================================================ */

/* Grilla de colores sugeridos */
.color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-preset {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--cream);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  font-family: inherit;
}
.color-preset:hover {
  border-color: var(--olive);
  background: var(--cream-2);
}
.color-preset.is-active {
  border-color: var(--olive);
  background: var(--cream-2);
  box-shadow: 0 0 0 2px var(--olive);
}
.color-preset__swatch {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,.12);
  display: block;
  flex-shrink: 0;
}
.color-preset__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .02em;
}
.color-preset.is-active .color-preset__label {
  color: var(--olive);
}

/* Preview del portal */
.color-preview {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  max-width: 460px;
}
.color-preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.color-preview__logo {
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-serif);
  font-style: italic;
}
.color-preview__nav {
  display: flex;
  gap: 14px;
  font-size: 12px;
  font-weight: 500;
}
.color-preview__nav .active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.color-preview__body {
  padding: 16px;
  background: #f5f1e8;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.color-preview__chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  width: fit-content;
}
.color-preview__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #1a1f10;
}
.color-preview__meta {
  font-size: 11px;
  color: #8a8b6d;
}
.color-preview__btn {
  margin-top: 4px;
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  width: fit-content;
}

@media (max-width: 480px) {
  .color-presets { gap: 6px; }
  .color-preset { padding: 6px 10px 6px 6px; }
  .color-preset__swatch { width: 20px; height: 20px; }
  .color-preview__nav { display: none; }
}


/* ═══════════════════════════════════════════════════════
   IMAGE EDITOR — iOS Style — DosLagunas Admin
════════════════════════════════════════════════════════ */

/* Preview wrap buttons */
.img-preview-actions {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.img-preview-actions .img-preview-btn { position: static; }

/* ── Overlay ── */
.ied-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0;
}

/* ── Sheet ── */
.ied-sheet {
  width: 100%;
  max-width: 560px;
  background: #1c1c1e;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 92dvh;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  color: #fff;
  margin: 16px;
}

/* En mobile ocupa toda la pantalla desde abajo */
@media (max-width: 639px) {
  .ied-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .ied-sheet {
    margin: 0;
    border-radius: 20px 20px 0 0;
    max-height: 94dvh;
    width: 100%;
  }
}

/* Handle bar — solo mobile */
.ied-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
  display: none;
}
@media (max-width: 639px) { .ied-handle { display: block; } }

/* ── Header ── */
.ied-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  flex-shrink: 0;
}
.ied-header-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
}
.ied-btn-text {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  color: rgba(255,255,255,.5);
  transition: color .15s;
  min-width: 68px;
  touch-action: manipulation;
}
.ied-btn-text:hover { color: rgba(255,255,255,.85); }
.ied-done { color: #0a84ff; font-weight: 700; text-align: right; }
.ied-done:hover { color: #3fa0ff; }
.ied-cancel-top { text-align: left; }

/* ── Viewport ── */
.ied-viewport {
  flex-shrink: 0;
  height: 200px;
  background: #000;
  position: relative;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
@media (min-height: 680px)  { .ied-viewport { height: 230px; } }
@media (min-height: 780px)  { .ied-viewport { height: 270px; } }
@media (min-height: 900px)  { .ied-viewport { height: 310px; } }
@media (min-width: 640px)   { .ied-viewport { height: 260px; } }

.ied-canvas-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  --vignette-op: 0;
}
.ied-canvas-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.9) 100%);
  opacity: var(--vignette-op);
  pointer-events: none;
  z-index: 2;
  transition: opacity .2s;
}

#iedImg {
  position: absolute;
  display: block;
  transform-origin: center center;
  max-width: none;
  max-height: none;
  pointer-events: none;
  will-change: transform, filter;
  -webkit-user-drag: none;
}

/* Grid de encuadre */
.ied-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity .4s;
}
.ied-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}
.ied-corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: #fff; border-style: solid; border-width: 0;
}
.ied-corner--tl { top: 0; left: 0;   border-top-width: 2px; border-left-width: 2px; }
.ied-corner--tr { top: 0; right: 0;  border-top-width: 2px; border-right-width: 2px; }
.ied-corner--bl { bottom: 0; left: 0;  border-bottom-width: 2px; border-left-width: 2px; }
.ied-corner--br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

/* ── Tabs ── */
.ied-tabs {
  display: flex;
  justify-content: center;
  padding: 8px 16px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.ied-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  position: relative;
  bottom: -1px;
  touch-action: manipulation;
}
.ied-tab svg { opacity: .45; transition: opacity .15s; }
.ied-tab.is-active { color: #0a84ff; border-bottom-color: #0a84ff; }
.ied-tab.is-active svg { opacity: 1; }

/* ── Panels ── */
.ied-panel {
  display: none;
  flex-direction: column;
  padding: 10px 16px 4px;
  overflow-y: auto;
  flex-shrink: 0;
  max-height: 200px;
  -webkit-overflow-scrolling: touch;
}
.ied-panel.is-active { display: flex; }
@media (max-width: 639px) {
  .ied-panel { max-height: 180px; padding: 8px 14px 4px; }
}

/* Sliders */
.ied-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.ied-slider-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,.5);
  min-width: 76px;
  flex-shrink: 0;
}
.ied-slider-label svg { opacity: .6; flex-shrink: 0; }
.ied-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.15);
  cursor: pointer;
  outline: none;
  touch-action: none;
}
.ied-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  cursor: grab;
}
.ied-range::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  border: none;
}
.ied-range-val {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 639px) {
  .ied-slider-label { min-width: 68px; font-size: 10.5px; }
  .ied-range::-webkit-slider-thumb { width: 26px; height: 26px; }
}

/* ── Filtros ── */
#ied-panel-filters { max-height: 150px; padding: 10px 0 0; }
.ied-filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ied-filter-scroll::-webkit-scrollbar { display: none; }
.ied-filter-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  touch-action: manipulation;
}
.ied-filter-item span {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.4);
  letter-spacing: .02em;
  transition: color .15s;
}
.ied-filter-item.is-active span { color: #0a84ff; }
.ied-filter-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 2.5px solid transparent;
  transition: border-color .15s, transform .15s;
  overflow: hidden;
}
.ied-filter-item.is-active .ied-filter-thumb { border-color: #0a84ff; transform: scale(1.06); }
@media (max-width: 639px) {
  .ied-filter-thumb { width: 52px; height: 52px; }
}

/* ── Rotar ── */
#ied-panel-rotate {
  padding: 16px;
  max-height: none;
  align-items: center;
  justify-content: center;
}
.ied-rotate-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.ied-rotate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 14px 24px 12px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  touch-action: manipulation;
  min-width: 100px;
}
.ied-rotate-btn:active { transform: scale(.95); background: rgba(255,255,255,.16); }
@media (max-width: 639px) {
  .ied-rotate-btn { padding: 12px 20px 10px; min-width: 80px; }
}

/* ── Reset bar ── */
.ied-reset-bar {
  display: flex;
  justify-content: center;
  padding: 6px 16px 14px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.07);
}
@media (max-width: 639px) {
  .ied-reset-bar { padding-bottom: env(safe-area-inset-bottom, 14px); }
}
.ied-reset-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 20px;
  border-radius: 20px;
  transition: background .15s, color .15s;
  touch-action: manipulation;
}
.ied-reset-btn:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); }
