/* ESTILO PIXIESET: fondo blanco, tipografía liviana, fotos sin bordes redondeados, botones planos */
:root {
  --bg-color: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f6f6f6;
  --line: #e7e7e7;
  --line-strong: #cfcfcf;
  --text-main: #222222;
  --text-secondary: #8a8a8a;
  --accent: #222222;
  --accent-hover: #000000;
  --on-accent: #ffffff;
  --heart: #d9534f;
  --ok: #2e9e5b;
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --nav-h: 64px;
  --font-body: "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
  --font-title: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --transition: all 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== BARRA SUPERIOR ===== */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 1000;
}

.nav-content {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
}

.brand {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand i {
  font-size: 15px;
}

/* ===== BOTONES ===== */
.btn-apple {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--text-main);
}

/* Botón de la barra de herramientas de la galería (texto + icono, sin caja) */
.btn-tool {
  background: transparent;
  color: var(--text-main);
  border: 1px solid transparent;
  padding: 8px 12px;
  font-size: 11px;
}

.btn-tool:hover,
.btn-tool.active {
  background: var(--surface-alt);
}

/* Botón con borde blanco sobre la portada */
.btn-hero {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 14px 34px;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.btn-hero:hover {
  background: #ffffff;
  color: #222222;
}

/* Compatibilidad con clases antiguas */
.btn-glass {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--line-strong);
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) 32px 60px;
}

.hidden {
  display: none !important;
}

/* ===== PANEL DEL FOTÓGRAFO ===== */
#adminView {
  min-height: 100vh;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.admin-header h2 {
  font-family: var(--font-title);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.form-card {
  margin-bottom: 40px;
  max-width: 640px;
}

.form-card h3 {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--text-main);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px 24px;
}

.album-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.album-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.album-thumb {
  display: block;
  height: 210px;
  width: 100%;
  object-fit: cover;
  background: var(--surface-alt);
}

.album-info {
  padding: 18px;
}

.album-info h4 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 4px;
}

.album-actions-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.album-actions-bar .btn-apple {
  padding: 8px 12px;
  font-size: 11px;
}

.album-progress {
  margin-top: 14px;
}

.album-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  color: #c4c4c4;
  font-size: 34px;
}

.btn-stage {
  margin-top: 12px;
  width: 100%;
}

/* ===== PORTADA (VISTA CLIENTE) ===== */
#clientView.container {
  max-width: none;
  padding: var(--nav-h) 0 0;
}

.client-hero {
  position: relative;
  height: calc(100vh - var(--nav-h));
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background-color: #2a2a2a;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.85;
}

.hero-content h1 {
  font-family: var(--font-title);
  font-size: clamp(44px, 8vw, 92px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.05;
  margin: 18px 0 14px;
}

.hero-date {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 36px;
}

/* ===== GALERÍA ===== */
.gallery-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.gallery-header {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  margin: 0 -24px 24px;
  padding: 10px 24px;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.quality-tag {
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 20px;
}

.gallery-grid {
  column-width: 300px;
  column-gap: 10px;
}

.photo-item {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface-alt);
  margin-bottom: 10px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  cursor: pointer;
}

.photo-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.3) 100%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 10px;
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  color: #222222;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.gallery-empty {
  column-span: all;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 80px 0;
}

.fav-count {
  background: var(--surface-alt);
  border-radius: 980px;
  padding: 0 7px;
  font-size: 11px;
}

.btn-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  opacity: 0;
}

.photo-item:hover .btn-fav,
.btn-fav.active {
  opacity: 1;
}

.btn-fav.active i {
  color: var(--heart);
}

/* ===== VISOR (LIGHTBOX) CLARO ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
}

.lightbox-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

.lightbox-content {
  max-width: 92vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.lightbox-content img.is-preview {
  filter: blur(8px);
}

.lightbox-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  z-index: 1;
  transition: var(--transition);
}

.lightbox-nav:hover {
  background: var(--surface-alt);
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

#lbFav.active i {
  color: var(--heart);
}

/* ===== AVISO (TOAST) ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--on-accent);
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 3000;
}

/* ===== SELECTOR DE ARCHIVOS ===== */
.form-group input[type="file"] {
  padding: 9px;
  cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  margin-right: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-apple:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ===== BARRA DE PROGRESO ===== */
.progress {
  height: 4px;
  border-radius: 980px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== VISTA DE ESPERA (CLIENTE) ===== */
.pending-wrap {
  min-height: calc(100vh - var(--nav-h) - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pending-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
}

.pending-cover {
  height: 220px;
  background-size: cover;
  background-position: center;
}

.pending-body {
  padding: 40px 36px;
}

.pending-body .badge {
  color: var(--text-secondary);
}

.pending-body h1 {
  font-family: var(--font-title);
  font-size: 46px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 12px 0 6px;
}

.pending-body .hero-date {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.pending-message {
  font-size: 16px;
  margin-bottom: 28px;
}

.steps {
  list-style: none;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.step.done {
  color: var(--text-main);
}

.step.done .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.step.current {
  color: var(--text-main);
  font-weight: 700;
}

.step.current .step-dot {
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.25); }
  70% { box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

.pending-note {
  margin-top: 28px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.pending-note-tight {
  margin-top: 10px;
}

.pending-contact {
  color: #1fa855;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.pending-contact:hover {
  text-decoration: underline;
}

/* ===== VENTANITAS ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px 26px 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  animation: modal-pop 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card h3 {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 600;
}

.modal-card .subtitle {
  margin-bottom: 18px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
}

.stage-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.stage-option:hover {
  background: var(--surface-alt);
}

.stage-option-title {
  flex: 1;
}

.stage-option-percent {
  color: var(--text-secondary);
  font-size: 12px;
}

.stage-option.done .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.stage-option.active {
  border-color: var(--accent);
  font-weight: 700;
}

.stage-option.active .step-dot {
  border-color: var(--accent);
  color: var(--accent);
}

#zipParts {
  max-height: 55vh;
  overflow-y: auto;
}

#zipParts.busy {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== AVISO POR WHATSAPP ===== */
.btn-whatsapp {
  background-color: #25d366;
  color: #04210f;
  border-color: #25d366;
}

.btn-whatsapp:hover {
  background-color: #1fb958;
}

.notify-preview {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.notify-warning {
  font-size: 12px;
  color: #b9770e;
  margin-bottom: 14px;
}

/* ===== PANEL: ESTADÍSTICAS ===== */
.album-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.stat {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}

.stat i {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.stat b {
  display: block;
  font-size: 18px;
  color: var(--text-main);
}

.stat .fa-heart {
  color: var(--heart);
}

.stat-line {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.stat-ok {
  color: var(--ok);
}

/* ===== ACCESIBILIDAD ===== */
.photo-item:focus-visible,
.btn-apple:focus-visible,
.btn-icon:focus-visible,
.lightbox-nav:focus-visible,
.lightbox-close:focus-visible,
.modal-close:focus-visible,
.stage-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.photo-item:focus-within .photo-overlay,
.photo-item:focus-within .btn-fav {
  opacity: 1;
}

@media (hover: none) {
  .photo-overlay {
    opacity: 1;
    background: none;
  }
  .btn-fav { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== MODO SELECCIÓN ===== */
.photo-item .select-check {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.3);
  color: transparent;
  font-size: 13px;
  align-items: center;
  justify-content: center;
}

.btn-zoom {
  display: none;
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
}

.select-mode .photo-item .select-check,
.select-mode .btn-zoom {
  display: flex;
}

.select-mode .photo-overlay,
.select-mode .btn-fav {
  display: none;
}

.photo-item.selected .select-check {
  background: var(--accent);
  border-color: #fff;
  color: #fff;
}

.select-mode .photo-item.selected {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.select-mode .photo-item.selected img {
  opacity: 0.85;
}

.select-bar {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(760px, calc(100% - 24px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  z-index: 1500;
}

.select-count {
  font-size: 14px;
  font-weight: 700;
}

.select-tools,
.select-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.select-bar .btn-apple {
  padding: 8px 14px;
}

.select-bar .btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.select-mode .gallery-container {
  padding-bottom: 150px;
}

.select-mode .toast {
  bottom: 150px;
}

/* ===== CELULARES ===== */
@media (max-width: 600px) {
  :root { --nav-h: 56px; }
  .container { padding: calc(var(--nav-h) + 24px) 16px 32px; }
  #clientView.container { padding: var(--nav-h) 0 0; }
  .nav-content { padding: 0 16px; }
  .brand { font-size: 11px; letter-spacing: 0.12em; }
  .brand i { display: none; }
  #btnAdmin { padding: 8px 12px; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .admin-header h2 { font-size: 30px; }
  .albums-grid { grid-template-columns: 1fr; }
  .gallery-container { padding: 0 6px 40px; }
  .gallery-header { margin: 0 -6px 12px; padding: 8px 10px; }
  .gallery-grid { column-width: auto; column-count: 2; column-gap: 6px; }
  .photo-item { margin-bottom: 6px; }
  .toolbar-actions .btn-tool { padding: 8px; }
  .pending-body { padding: 28px 22px; }
  .pending-body h1 { font-size: 36px; }
  .pending-cover { height: 160px; }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
  .select-count { order: 1; }
  .select-main { order: 2; }
  .select-tools { order: 3; width: 100%; }
  .select-tools .btn-apple { flex: 1; }
  .select-mode .toast { bottom: 170px; }
}

.gallery-container { scroll-margin-top: var(--nav-h); }

/* ===== ACCESO: INVITADO / CLIENTE ===== */
.access-options { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.access-options .btn-apple { flex: 1; min-width: 140px; padding: 14px 18px; }
.pin-form { text-align: left; }
.pin-form label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.pin-form input { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px; font-family: inherit; font-size: 20px; text-align: center; letter-spacing: 0.4em; outline: none; margin-bottom: 14px; }
.pin-form input:focus { border-color: var(--text-main); }
.pin-error { color: var(--heart); font-size: 13px; margin: -6px 0 12px; text-align: center; }
.pin-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-link { background: none; border: none; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--text-main); text-decoration: underline; cursor: pointer; }
.guest-only { display: none; }
.guest-mode .guest-only { display: inline-flex; }
.guest-mode .client-only,
.guest-mode .btn-fav,
.guest-mode .photo-overlay,
.guest-mode .btn-zoom,
.guest-mode .select-check,
.guest-mode .select-bar { display: none !important; }
.guest-mode .photo-item img,
.guest-mode .lightbox-content img { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* =====================================================================
   VISTA CLIENTE ESTILO PIXIESET (portada, encabezado, categorías, columnas)
   ===================================================================== */
:root {
  --grid-gap: 6px;                           /* espacio entre fotos (igual horizontal y vertical) */
  --grid-margin: 20px;                       /* margen a los costados de la galería */
  --px-compact-h: 60px;
}

/* Sin la barra del panel: la portada ocupa toda la pantalla */
body.client-page .nav-bar { display: none; }
#clientView.container { padding: 0; max-width: none; }

.client-hero {
  height: 100vh;
  height: 100svh;
  min-height: 480px;
}

.hero-brand {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.hero-brand small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3em;
  opacity: 0.8;
}

.px-sentinel { height: 1px; margin-top: -1px; }

/* ----- Encabezado: título, acciones y categorías ----- */
.px-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.px-header-inner {
  max-width: none;
  margin: 0 auto;
  padding: 34px var(--grid-margin) 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.px-title {
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.px-title-link {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.1;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.px-brand {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.px-actions {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
}

.px-actions .btn-tool {
  gap: 7px;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-main);
}
.px-actions .btn-tool i { font-size: 13px; }
.px-actions .btn-tool.active i.fa-heart { color: var(--heart); }

.px-sets {
  order: 3;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 30px;
  width: 100%;
}

.px-set {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 10px 0;
  text-transform: uppercase;
  white-space: nowrap;
  transition: var(--transition);
}
.px-set:hover { color: var(--text-main); }
.px-set.active {
  color: var(--text-main);
  border-bottom-color: var(--text-main);
}
.px-set:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Menú "más" (tres puntos) */
.px-more { position: relative; }
.px-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 80;
}
.px-menu .btn-apple {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
}
.px-menu .guest-only { display: none; }
.guest-mode .px-menu .guest-only { display: flex; }

/* Barra compacta al bajar (como Pixieset): título a la izquierda, categorías al centro, iconos a la derecha */
.px-header.is-stuck .px-header-inner {
  flex-direction: row;
  justify-content: space-between;
  height: var(--px-compact-h);
  padding: 0 var(--grid-margin);
  gap: 20px;
}
.px-header.is-stuck .px-title {
  align-items: flex-start;
  flex-shrink: 0;
  max-width: 28%;
}
.px-header.is-stuck .px-title-link { font-size: 22px; }
.px-header.is-stuck .px-brand { display: none; }
.px-header.is-stuck .px-sets {
  order: 2;
  flex: 1;
  width: auto;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0 26px;
  overflow-x: auto;
  scrollbar-width: none;
}
.px-header.is-stuck .px-sets::-webkit-scrollbar { display: none; }
.px-header.is-stuck .px-set { padding: 21px 0 19px; }
.px-header.is-stuck .px-actions { order: 3; flex-wrap: nowrap; flex-shrink: 0; }
.px-header.is-stuck .px-label { display: none; }
.px-header.is-stuck .px-actions .btn-tool { padding: 9px 10px; }
.px-menu .px-label { display: inline; }

/* ----- Galería en columnas ----- */
.gallery-container {
  max-width: none;
  margin: 0 auto;
  padding: 0 var(--grid-margin) 60px;
}

.set-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 0 24px;
}
.set-title {
  font-family: var(--font-title);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.photo-count {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-grid {
  display: flex;
  align-items: flex-start;
  gap: var(--grid-gap);
  column-width: auto;
}
.gallery-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
}
.gallery-col .photo-item { margin-bottom: 0; width: 100%; }
.gallery-grid .gallery-empty { flex: 1; }

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 36px 0 10px;
}
.load-more-wrap .btn-apple { padding: 12px 34px; letter-spacing: 0.18em; }

.quality-tag { margin: 28px 0 0; }

.px-footer {
  border-top: 1px solid var(--line);
  padding: 26px 24px 34px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ----- Panel: casillas y campos nuevos ----- */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.check-row input[type="checkbox"],
.form-group .check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.field-hint {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  margin: 6px 0 12px;
}
#setNamesWrap { margin-top: 10px; }

/* ----- Editor de categorías ----- */
.sets-list { list-style: none; margin: 14px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-row .set-name,
.sets-add input {
  flex: 1;
  min-width: 160px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.set-row .set-name:focus,
.sets-add input:focus { border-color: var(--text-main); }
.set-count { color: var(--text-secondary); font-size: 12px; min-width: 64px; }
.btn-mini {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
}
.btn-mini:hover:not(:disabled) { border-color: var(--text-main); }
.btn-mini:disabled { opacity: 0.35; cursor: not-allowed; }
.sets-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.assign-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 12px;
}
.assign-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.assign-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.assign-field select {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
  text-transform: none;
  letter-spacing: 0;
  max-width: 240px;
}
.move-panel {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.assign-count { font-size: 13px; font-weight: 700; }
.move-panel .btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.edit-grid .gallery-empty { grid-column: 1 / -1; }
.edit-photo {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface-alt);
  overflow: hidden;
  cursor: pointer;
}
.edit-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-photo.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.edit-tag {
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-tag.none { background: rgba(217, 83, 79, 0.85); }
.edit-pick {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.edit-pick i { opacity: 0; }
.edit-photo.picked .edit-pick { background: var(--accent); color: var(--on-accent); }
.edit-photo.picked .edit-pick i { opacity: 1; }
.edit-photo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- Celulares ----- */
@media (max-width: 600px) {
  :root { --grid-gap: 6px; --grid-margin: 6px; --px-compact-h: 54px; }
  #clientView.container { padding: 0; }
  .px-header-inner { padding: 26px 12px 4px; }
  .px-actions .btn-tool { padding: 8px 8px; }
  .px-actions .px-label { display: none; }
  .px-sets {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0 22px;
    scrollbar-width: none;
    padding: 0 4px;
  }
  .px-sets::-webkit-scrollbar { display: none; }
  .px-header.is-stuck .px-header-inner { padding: 0 10px; gap: 8px; }
  .px-header.is-stuck .px-title { max-width: 30%; }
  .px-header.is-stuck .px-title-link { font-size: 18px; }
  .px-header.is-stuck .px-set { padding: 18px 0 16px; }
  .gallery-container { padding: 0 var(--grid-margin) 32px; }
  .set-heading { padding: 26px 0 16px; }
  .hero-brand { top: 20px; }
  .move-panel .assign-buttons { width: 100%; }
  .assign-field select { max-width: 160px; }
}

/* Dentro del menú "más" las etiquetas siempre se ven */
.px-actions .px-menu .px-label { display: inline; }


/* Encabezado: en su lugar mientras se ve completo; fijo arriba (compacto) al bajar.
   El contenedor reserva su alto para que la página no cambie de tamaño. */
.px-holder { position: relative; }
.px-header { position: relative; top: auto; }
.px-header.is-stuck {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  box-shadow: 0 1px 0 var(--line);
}
/* Siempre hay recorrido suficiente para que la barra se fije, incluso con pocas fotos */
.gallery-container { min-height: calc(100vh - var(--px-compact-h)); }

/* ----- Ajustes del álbum ----- */
.settings-card { margin-bottom: 20px; }
.settings-card h3 { margin-bottom: 6px; }
.settings-card .field-hint { margin: 0 0 14px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.settings-buttons { justify-content: flex-start; }
.settings-value { font-size: 18px; letter-spacing: 0.12em; }
.settings-value i { font-size: 14px; color: var(--text-secondary); margin-right: 6px; }
.btn-danger { color: var(--heart); border-color: var(--heart); }
.btn-danger:hover { background: var(--heart); color: #ffffff; border-color: var(--heart); }

/* ----- Agenda ----- */
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.book-card { max-width: 900px; margin-bottom: 40px; padding: 32px; }
.book-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); gap: 40px; align-items: start; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.cal-title { font-family: var(--font-title); font-size: 26px; font-weight: 600; }
.cal-nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-secondary); padding: 8px 0 10px; }
.cal-day {
  position: relative;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.cal-day:hover:not(:disabled) { background: var(--surface-alt); }
.cal-day.past { color: #c4c4c4; font-weight: 400; cursor: default; }
.cal-day.today::after,
.cal-day.busy::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--text-main);
}
.cal-day.busy:not(.today)::after { background: var(--heart); }
.cal-day.selected { background: var(--accent); color: var(--on-accent); }
.cal-day.selected::after { background: var(--on-accent); }
.cal-day:focus-visible, .time-slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.book-hint { color: var(--text-secondary); font-size: 14px; padding-top: 12px; }
.book-steps { display: flex; flex-direction: column; gap: 18px; }
.book-step { animation: modal-pop 0.25s cubic-bezier(0.25, 1, 0.5, 1); }
.book-step.form-group { margin-bottom: 0; }
.book-day { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 280px; overflow-y: auto; padding: 2px; }
.time-slot {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 11px 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.time-slot small { display: block; font-size: 10px; color: var(--text-secondary); }
.time-slot:hover:not(:disabled) { border-color: var(--text-main); }
.time-slot.selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.time-slot:disabled { opacity: 0.4; cursor: not-allowed; }

.agenda-title { font-family: var(--font-title); font-size: 30px; font-weight: 500; margin: 8px 0 18px; }
.agenda-empty { color: var(--text-secondary); font-size: 14px; margin-bottom: 40px; }
.agenda-day { max-width: 900px; margin-bottom: 26px; }
.agenda-date { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.agenda-item { display: flex; align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 8px; background: var(--surface); }
.agenda-time { font-size: 20px; font-weight: 700; min-width: 64px; }
.agenda-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agenda-info b { font-size: 16px; }
.agenda-info span { font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.agenda-info i { width: 14px; margin-right: 4px; }

@media (max-width: 760px) {
  .book-card { padding: 20px 16px; }
  .book-grid { grid-template-columns: 1fr; gap: 28px; }
  .agenda-item { gap: 12px; padding: 12px; }
}

/* ----- Login del panel ----- */
#navRight { display: flex; gap: 8px; align-items: center; }
.login-card { max-width: 440px; }
.login-card .pending-body { padding: 44px 36px 38px; }
.login-card .pending-message { margin-bottom: 26px; font-size: 14px; color: var(--text-secondary); }
.login-form { text-align: left; }
.login-form .form-group { margin-bottom: 16px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle { position: absolute; top: 0; right: 0; height: 100%; width: 42px; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 14px; }
.pass-toggle:hover { color: var(--text-main); }
.login-form .pin-error { margin: 0 0 14px; text-align: left; }
.login-submit { width: 100%; padding: 13px 18px; margin-top: 4px; }
@media (max-width: 600px) { .login-card .pending-body { padding: 32px 22px 28px; } }

/* ----- Agenda: edición, costos, estados ----- */
.book-heading { font-family: var(--font-title); font-size: 28px; font-weight: 500; margin-bottom: 22px; }
.agenda-item { align-items: flex-start; }
.agenda-time { padding-top: 2px; }
.agenda-info > span, .agenda-info > b { display: block; }
.agenda-info .owe { font-size: 14px; color: var(--heart); }
.agenda-info .owe-soft { color: #b9770e; font-weight: 700; }
.agenda-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line-strong); color: var(--text-secondary); border-radius: 2px; }
.tag-ok { border-color: var(--ok); color: var(--ok); }
.tag-warn { border-color: #b9770e; color: #b9770e; }
.agenda-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex-shrink: 0; max-width: 84px; }
.agenda-actions .btn-mini { width: 34px; height: 34px; }

/* ----- Ventanitas de estado/pago y gastos ----- */
.modal-card { max-height: calc(100vh - 48px); overflow-y: auto; }
.modal-field { margin: 16px 0 0; }
.modal-field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--text-secondary); margin-bottom: 6px; }
.modal-field input { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 12px; color: var(--text-main); font-family: inherit; font-size: 14px; outline: none; }
.modal-field input:focus { border-color: var(--text-main); }
.modal-label { margin: 20px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.pay-options { display: flex; flex-direction: column; gap: 8px; }
.pay-option { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); font-size: 14px; cursor: pointer; transition: var(--transition); }
.pay-option:hover { background: var(--surface-alt); }
.pay-option:has(input:checked) { border-color: var(--accent); font-weight: 700; }
.pay-option input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.pay-summary { margin: 18px 0 20px; padding: 12px 14px; background: var(--surface-alt); border-radius: var(--radius-md); font-size: 13px; font-weight: 700; line-height: 1.5; }

/* ----- Finanzas ----- */
.fin-month-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.fin-month-label { font-family: var(--font-title); font-size: 30px; font-weight: 500; min-width: 220px; text-align: center; }
.fin-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.fin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 18px; }
.fin-card span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 8px; }
.fin-card b { display: block; font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.fin-card-main { border-color: var(--accent); }
.neg { color: var(--heart); }
.fin-breakdown { max-width: 640px; margin-bottom: 36px; padding: 22px; }
.fin-breakdown h4 { font-family: var(--font-title); font-size: 22px; font-weight: 600; margin-bottom: 14px; }
.fin-bar-row { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; }
.fin-bar { height: 6px; background: var(--line); border-radius: 980px; overflow: hidden; }
.fin-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.fin-empty { margin-bottom: 0; }
.fin-scroll { overflow-x: auto; margin-bottom: 30px; }
.fin-table { width: 100%; max-width: 1000px; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.fin-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.fin-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fin-table td small { display: block; color: var(--text-secondary); font-size: 12px; }
.fin-table .r { text-align: right; white-space: nowrap; }
.fin-table tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: none; }
.fin-year { max-width: 640px; }
.fin-month-row { cursor: pointer; }
.fin-month-row:hover { background: var(--surface-alt); }
.fin-month-row.current { background: var(--surface-alt); font-weight: 700; }
.fin-month-row.empty { color: var(--text-secondary); }
.fin-month-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

@media (max-width: 760px) {
  .fin-cards { grid-template-columns: repeat(2, 1fr); }
  .fin-card b { font-size: 19px; }
  .fin-month-label { font-size: 24px; min-width: 0; flex: 1; }
  .fin-bar-row { grid-template-columns: 1fr auto; }
  .fin-bar-row .fin-bar { grid-column: 1 / -1; order: 3; }
  .agenda-actions { max-width: 76px; }
}

/* ===== MENÚ HAMBURGUESA + ÁLBUMES EN EL CELULAR ===== */

/* Escritorio: el menú se ve igual que antes (Inicio y Salir en la barra) */
.nav-burger { display: none; }
.nav-menu { display: flex; gap: 8px; align-items: center; }
.menu-only { display: none; }
.album-toggle { display: none; }

@media (max-width: 600px) {
  /* --- Barra superior: nombre + botón hamburguesa --- */
  .brand { min-width: 0; }
  #brandName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 17px;
    cursor: pointer;
  }
  /* Solo aparece con la sesión iniciada (cuando existe el botón Salir) */
  #navRight:has(#btnLogout.hidden) .nav-burger { display: none; }

  .nav-menu {
    display: none;
    position: absolute;
    top: calc(var(--nav-h) - 4px);
    right: 12px;
    min-width: 210px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  }
  .nav-menu.open { display: flex; }
  #navMenu .btn-apple {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 14px;
    border-color: transparent;
    font-size: 12px;
  }
  #navMenu .btn-apple:hover,
  #navMenu .btn-apple:active { background: var(--surface-alt); }
  #navMenu .btn-apple i { width: 18px; text-align: center; }
  #navMenu .menu-only { display: inline-flex; }

  /* --- Panel: solo "Crear nuevo álbum" a la vista --- */
  #adminView .header-actions { width: 100%; }
  #adminView .header-actions #btnAgenda,
  #adminView .header-actions #btnFinance { display: none; }
  #adminView #btnNewAlbum { width: 100%; padding: 13px 18px; }

  /* --- Álbumes de a dos --- */
  .albums-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;   /* si se abre uno, el de al lado no se estira */
  }
  .album-thumb { height: 120px; }
  .album-thumb-empty { font-size: 26px; }

  .album-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
  }
  .album-info > h4 { order: 1; font-size: 19px; overflow-wrap: anywhere; }
  .album-info > .subtitle { order: 2; font-size: 11px; line-height: 1.35; }
  .album-progress { order: 3; margin-top: 10px; }
  .album-progress .progress-meta { font-size: 10px; }
  .album-toggle { order: 4; }
  .album-more { order: 5; display: none; }
  .album-actions-bar { order: 6; display: none; }

  /* Flechita para desplegar las opciones */
  .album-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 34px;
    margin-top: 10px;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 13px;
    cursor: pointer;
  }
  .album-toggle i { transition: transform 0.25s ease; }
  .album-card.open .album-toggle i { transform: rotate(180deg); }

  /* Opciones desplegadas */
  .album-card.open .album-more { display: block; }
  .album-card.open .album-actions-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
  }
  .album-actions-bar .btn-apple {
    padding: 10px 6px;
    font-size: 10px;
    letter-spacing: 0.04em;
    gap: 5px;
  }
  /* Si queda un botón solo en la última fila, ocupa todo el ancho */
  .album-actions-bar .btn-apple:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* Estadísticas en una columna para que entren en media pantalla */
  .album-stats { grid-template-columns: 1fr; gap: 4px; margin-top: 10px; }
  .stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    font-size: 10.5px;
    text-align: left;
  }
  .stat i { display: inline-block; width: 14px; margin: 0; text-align: center; font-size: 11px; }
  .stat b { display: inline; font-size: 13px; }
  .album-more .stat-line { font-size: 11px; }
}


/* ===== MENÚ LATERAL IZQUIERDO (escritorio, estilo Instagram) ===== */
@media (min-width: 601px) {
  /* El botón hamburguesa no hace falta: el menú queda siempre a la vista */
  .nav-burger { display: none; }

  /* Menú fijo a la izquierda, solo con la sesión iniciada */
  #navRight:has(#btnLogout.hidden) .nav-menu { display: none; }
  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    width: 240px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 12px 20px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }

  #navMenu .menu-only,
  #navMenu .menu-desktop-only { display: flex; }

  #navMenu .btn-apple {
    width: 100%;
    justify-content: flex-start;
    gap: 16px;
    padding: 13px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }
  #navMenu .btn-apple i { width: 24px; font-size: 20px; text-align: center; }
  #navMenu .btn-apple:hover { background: var(--surface-alt); }

  /* Salir queda abajo del todo */
  #navMenu #btnLogout { margin-top: auto; }

  /* Sección activa resaltada */
  body:has(#adminView:not(.hidden)) #btnAdmin,
  body:has(#editView:not(.hidden)) #btnAdmin,
  body:has(#settingsView:not(.hidden)) #btnAdmin,
  body:has(#agendaView:not(.hidden)) #menuAgenda,
  body:has(#financeView:not(.hidden)) #menuFinance {
    background: var(--surface-alt);
    font-weight: 700;
  }

  /* Deja lugar al menú: el contenido se centra en el espacio restante */
  body:has(#btnLogout:not(.hidden)):not(.client-page) { padding-left: 240px; }

  /* Esos botones ahora están en el menú: se sacan del encabezado del panel */
  #adminView .header-actions { display: none; }
}


/* ===== MODO OSCURO (solo panel del fotógrafo) ===== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--text-main); }

html.dark body:not(.client-page) {
  --bg-color: #121212;
  --surface: #1c1c1e;
  --surface-alt: #262628;
  --line: #2e2e30;
  --line-strong: #48484a;
  --text-main: #ececec;
  --text-secondary: #9a9a9f;
  --accent: #f2f2f2;
  --accent-hover: #ffffff;
  --on-accent: #121212;
  --heart: #ff6b66;
  color-scheme: dark;
}
html.dark body:not(.client-page) .album-thumb-empty { color: #5a5a5e; }


/* ===== PORTAFOLIO ===== */
@media (min-width: 601px) {
  body:has(#portfolioView:not(.hidden)) #menuPortfolio {
    background: var(--surface-alt);
    font-weight: 700;
  }
}

.pf-root { color: var(--text-main); }
.pf-block { position: relative; }
.pf-inner { max-width: 1100px; margin: 0 auto; padding: 88px 24px; }
.pf-empty { text-align: center; padding: 140px 24px; color: var(--text-secondary); font-size: 15px; }
.pf-empty i { display: block; font-size: 40px; margin-bottom: 14px; color: var(--line-strong); }

/* --- Portada --- */
.pf-hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; background: #2a2a2a; color: #ffffff; overflow: hidden; }
.pf-hero-bg, .pf-hero-shade { position: absolute; inset: 0; }
.pf-hero-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-hero-shade { background: rgba(0, 0, 0, 0.32); }
.pf-hero-body { position: relative; z-index: 1; max-width: 900px; padding: 120px 28px; }
.pf-hero-title { font-family: var(--font-title); font-weight: 500; font-size: clamp(34px, 5.4vw, 68px); line-height: 1.12; letter-spacing: 0.005em; white-space: pre-wrap; }

/* --- Galería / texto --- */
.pf-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.pf-subtitle { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 14px; }
.pf-title { font-family: var(--font-title); font-weight: 500; font-size: clamp(32px, 4.4vw, 54px); line-height: 1.1; margin-bottom: 20px; white-space: pre-wrap; }
.pf-par { font-size: 16px; line-height: 1.85; color: var(--text-secondary); white-space: pre-wrap; }
.pf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pf-tile { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface-alt); margin: 0; }
.pf-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.pf-public .pf-tile { cursor: zoom-in; }
.pf-public .pf-tile:hover img { transform: scale(1.03); }

/* --- Cita --- */
.pf-quote-grid { max-width: 1100px; margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.pf-quote-img { position: relative; aspect-ratio: 4 / 5; background: var(--surface-alt); overflow: hidden; }
.pf-quote-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-quote { font-family: var(--font-title); font-style: italic; font-weight: 500; font-size: clamp(26px, 3.2vw, 42px); line-height: 1.25; margin-bottom: 24px; white-space: pre-wrap; }
.pf-author { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-secondary); }
.pf-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; color: var(--line-strong); }

/* --- Contacto --- */
.pf-center { max-width: 820px; margin: 0 auto; padding: 96px 24px 88px; text-align: center; }
.pf-contact-title { font-family: var(--font-title); font-weight: 500; font-size: clamp(30px, 4vw, 48px); line-height: 1.18; margin-bottom: 36px; white-space: pre-wrap; }
.pf-contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 20px; }
.pf-contact-links a { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-main); text-decoration: none; font-size: 13px; font-weight: 600; transition: var(--transition); }
.pf-contact-links a:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pf-address { font-size: 14px; color: var(--text-secondary); }
.pf-address i { margin-right: 6px; }
.pf-rows { display: flex; flex-direction: column; gap: 10px; max-width: 460px; margin: 0 auto; text-align: left; }
.pf-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.pf-row i { width: 20px; text-align: center; color: var(--text-secondary); }
.pf-row .pf-edit { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }

.pf-footer { text-align: center; padding: 32px 24px 44px; font-size: 12px; letter-spacing: 0.12em; color: var(--text-secondary); border-top: 1px solid var(--line); }

/* --- Menú superior (solo link público) --- */
.pf-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.pf-brand { font-family: var(--font-title); font-size: 26px; font-weight: 600; color: var(--text-main); text-decoration: none; }
.pf-links { display: flex; gap: 28px; }
.pf-links a { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-main); text-decoration: none; opacity: 0.75; transition: var(--transition); }
.pf-links a:hover { opacity: 1; }
.pf-burger { display: none; width: 42px; height: 42px; background: none; border: none; font-size: 18px; color: var(--text-main); cursor: pointer; }
.pf-public .pf-block { scroll-margin-top: 64px; }
body.portfolio-public #portfolioView.container { padding: 0; max-width: none; }

.pf-zoom { position: fixed; inset: 0; z-index: 3000; background: rgba(0, 0, 0, 0.94); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 24px; }
.pf-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* --- Controles de edición (solo en el panel) --- */
.pf-editing .pf-block { margin-bottom: 0; outline: 1px dashed var(--line-strong); outline-offset: -1px; background: var(--bg-color); }
.pf-editing .pf-hero { min-height: 56vh; }
.pf-editing .pf-inner { padding: 72px 24px 48px; }
.pf-editing .pf-center { padding-top: 88px; }
.pf-editing .pf-quote-grid { padding-top: 64px; }

.pf-edit { outline: none; cursor: text; border-radius: 3px; min-height: 1em; transition: background 0.15s ease; }
.pf-edit:hover { background: rgba(127, 127, 127, 0.14); }
.pf-edit:focus { background: rgba(127, 127, 127, 0.2); box-shadow: 0 0 0 2px var(--accent); }
.pf-edit:empty::before { content: attr(data-ph); opacity: 0.45; font-style: normal; }

.pf-tools {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
  max-width: calc(100% - 20px); padding: 6px 8px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14); color: var(--text-main);
}
.pf-type { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 0 6px; display: inline-flex; align-items: center; gap: 6px; }
.pf-menu-input { width: 150px; padding: 6px 8px; font-family: inherit; font-size: 12px; background: var(--surface-alt); color: var(--text-main); border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; }
.pf-menu-input:focus { border-color: var(--text-main); }
.pf-tools button, .pf-tile-tools button {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-alt); color: var(--text-main); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 13px;
}
.pf-tools button:hover:not(:disabled), .pf-tile-tools button:hover:not(:disabled) { border-color: var(--text-main); }
.pf-tools button:disabled, .pf-tile-tools button:disabled { opacity: 0.3; cursor: default; }
.pf-tools .pf-danger:hover, .pf-tile-tools .pf-danger:hover { background: var(--heart); border-color: var(--heart); color: #ffffff; }

.pf-imgbtns { position: absolute; left: 12px; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; }
.pf-imgbtns button {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; font-family: inherit; font-size: 12px; font-weight: 700;
  background: rgba(20, 20, 20, 0.78); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 6px; cursor: pointer;
}
.pf-imgbtns button:hover { background: rgba(0, 0, 0, 0.92); }
.pf-hero .pf-imgbtns { left: 50%; transform: translateX(-50%); bottom: 18px; }

.pf-tile-tools { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; justify-content: center; gap: 6px; opacity: 0; transition: opacity 0.2s ease; }
.pf-tile:hover .pf-tile-tools, .pf-tile:focus-within .pf-tile-tools { opacity: 1; }
@media (hover: none) { .pf-tile-tools { opacity: 1; } }
.pf-tile-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 2px dashed var(--line-strong); background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.pf-tile-add i { font-size: 22px; }
.pf-tile-add:hover { border-color: var(--text-main); color: var(--text-main); }

.pf-add { text-align: center; padding: 14px 0; }
.pf-add-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; background: transparent; color: var(--text-secondary); border: 1px dashed var(--line-strong); border-radius: 999px; cursor: pointer; transition: var(--transition); }
.pf-add-btn:hover { color: var(--text-main); border-color: var(--text-main); }
.pf-add-menu { display: none; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pf-add.open .pf-add-menu { display: flex; }
.pf-add-menu button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-family: inherit; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--text-main); border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; }
.pf-add-menu button:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

@media (max-width: 760px) {
  .pf-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pf-quote-grid { grid-template-columns: 1fr; gap: 28px; }
  .pf-inner { padding: 56px 18px; }
}
@media (max-width: 600px) {
  .pf-nav { padding: 0 16px; }
  .pf-burger { display: inline-flex; align-items: center; justify-content: center; }
  .pf-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: #ffffff; border-bottom: 1px solid var(--line); }
  .pf-nav.open .pf-links { display: flex; }
  .pf-links a { padding: 16px 20px; border-top: 1px solid var(--line); opacity: 1; }
  .pf-tools { position: static; margin: 10px; max-width: none; justify-content: flex-start; }
  .pf-menu-input { flex: 1; min-width: 120px; }
  .pf-editing .pf-hero { min-height: 48vh; flex-direction: column; justify-content: flex-start; align-items: stretch; }
  .pf-editing .pf-hero-body { padding: 36px 20px 80px; margin: 0 auto; }
  .pf-editing .pf-block { padding-top: 0; }
  .pf-editing .pf-inner { padding-top: 24px; }
  .pf-editing .pf-center { padding-top: 24px; }
  .pf-editing .pf-quote-grid { padding-top: 16px; }
}

/* ===== Portafolio: textos extra (títulos y párrafos) y contenedor vacío ===== */
.pf-extras { margin-top: 22px; }
.pf-blank .pf-extras { margin-top: 0; }
.pf-extra { position: relative; }
.pf-x-title { font-family: var(--font-title); font-weight: 500; font-size: clamp(24px, 3vw, 36px); line-height: 1.2; margin: 26px 0 12px; white-space: pre-wrap; }
.pf-x-par { font-size: 16px; line-height: 1.85; color: var(--text-secondary); margin: 0 0 14px; white-space: pre-wrap; }
.pf-hero .pf-x-par { color: inherit; opacity: 0.92; }
.pf-x-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.pf-x-tools { display: none; position: absolute; right: 0; top: -16px; z-index: 6; gap: 4px; }
.pf-extra:hover .pf-x-tools, .pf-extra:focus-within .pf-x-tools { display: flex; }
.pf-x-tools button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: var(--surface); color: var(--text-main); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.pf-x-tools button:hover:not(:disabled) { border-color: var(--text-main); }
.pf-x-tools button:disabled { opacity: 0.3; cursor: default; }
.pf-x-tools .pf-danger:hover { background: var(--heart); border-color: var(--heart); color: #ffffff; }
.pf-x-add { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.pf-x-add button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-family: inherit; font-size: 12px; font-weight: 700; background: transparent; color: var(--text-secondary); border: 1px dashed var(--line-strong); border-radius: 999px; cursor: pointer; transition: var(--transition); }
.pf-x-add button:hover { color: var(--text-main); border-color: var(--text-main); }
.pf-hero .pf-x-add button { color: #ffffff; border-color: rgba(255, 255, 255, 0.55); }
.pf-hero .pf-x-add button:hover { border-color: #ffffff; }
.pf-quote-text .pf-x-add { justify-content: flex-start; }
.pf-blank .pf-inner { min-height: 140px; }
@media (hover: none) {
  .pf-x-tools { display: flex; position: static; justify-content: center; margin-bottom: 6px; }
}


/* ===== Portafolio: lienzo libre del contenedor vacío ===== */
.pf-canvas-wrap { max-width: 1100px; margin: 0 auto; padding: 48px 24px 24px; }
.pf-canvas { position: relative; container-type: inline-size; width: 100%; }
.pf-editing .pf-canvas { outline: 1px dashed var(--line-strong); }
.pf-citem { position: absolute; }
.pf-canvas .pf-x-title { font-size: 3.4cqw; line-height: 1.2; margin: 0; }
.pf-canvas .pf-x-par { font-size: 1.7cqw; line-height: 1.7; margin: 0; }
.pf-cimg img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.pf-public .pf-cimg img { cursor: zoom-in; }
.pf-canvas > .pf-x-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 24px; text-align: center; pointer-events: none; }
.pf-citem-tools { display: none; position: absolute; left: 0; top: -34px; z-index: 8; gap: 4px; }
.pf-citem:hover .pf-citem-tools, .pf-citem:focus-within .pf-citem-tools, .pf-citem.dragging .pf-citem-tools { display: flex; }
.pf-citem-tools button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: var(--surface); color: var(--text-main); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.pf-citem-tools button:hover { border-color: var(--text-main); }
.pf-citem-tools .pf-danger:hover { background: var(--heart); border-color: var(--heart); color: #ffffff; }
.pf-grip { cursor: grab; touch-action: none; }
.pf-citem.dragging .pf-grip { cursor: grabbing; }
.pf-resize { display: none; position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: var(--accent); border: 2px solid var(--surface); border-radius: 50%; cursor: ew-resize; touch-action: none; z-index: 8; }
.pf-citem:hover .pf-resize, .pf-citem:focus-within .pf-resize, .pf-citem.dragging .pf-resize { display: block; }
.pf-editing .pf-citem:hover, .pf-editing .pf-citem:focus-within, .pf-citem.dragging { outline: 1px dashed var(--accent); outline-offset: 2px; }
.pf-citem.dragging { z-index: 9; user-select: none; }
.pf-guide { position: absolute; display: none; pointer-events: none; background: #e0457b; z-index: 7; }
.pf-guide-v { top: 0; bottom: 0; width: 1px; }
.pf-guide-h { left: 0; right: 0; height: 1px; }
.pf-blank .pf-x-add { margin-top: 18px; }

/* En pantallas angostas los elementos se apilan en orden (de arriba hacia abajo) */
@media (max-width: 760px) {
  .pf-canvas-wrap { padding: 32px 18px 16px; }
  .pf-canvas { aspect-ratio: auto !important; display: flex; flex-direction: column; gap: 18px; }
  .pf-canvas > .pf-x-hint { position: static; padding: 16px 0; }
  .pf-citem { position: static; width: 100% !important; }
  .pf-canvas .pf-x-title { font-size: 28px; }
  .pf-canvas .pf-x-par { font-size: 16px; }
  .pf-grip, .pf-resize, .pf-guide { display: none !important; }
  .pf-citem-tools { display: flex; position: static; margin-bottom: 6px; }
}


/* ===== Portafolio público: menú sobre la portada y texto de portada en celular ===== */
.pf-nav { transition: background 0.3s ease, border-color 0.3s ease; }
.pf-nav.pf-nav-over:not(.solid):not(.open) { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.pf-nav.pf-nav-over:not(.solid):not(.open) .pf-brand,
.pf-nav.pf-nav-over:not(.solid):not(.open) .pf-burger { color: #ffffff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); }
@media (min-width: 761px) {
  .pf-nav.pf-nav-over:not(.solid) .pf-links a { color: #ffffff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); }
}
@media (max-width: 760px) {
  .pf-public .pf-hero { min-height: 100vh; min-height: 100svh; align-items: flex-end; }
  .pf-public .pf-hero-shade { background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.12) 45%, rgba(0, 0, 0, 0.18) 100%); }
  .pf-public .pf-hero-body { padding: 120px 36px 68px; }
  .pf-public .pf-hero-title { font-size: 9.2vw; font-weight: 600; line-height: 1.16; }
}


/* Botón "Volver al panel" cuando el fotógrafo mira un álbum desde el panel */
.back-panel { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1500; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
body:has(#selectBar:not(.hidden)) .back-panel { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }


/* ===== Crear álbum: tarjeta superpuesta ===== */
.modal-card.modal-card-form { max-width: 560px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; }
.modal-card-form h3 { margin-bottom: 18px; }
.form-group select { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 12px; color: var(--text-main); font-family: inherit; font-size: 14px; outline: none; transition: border-color 0.2s ease; }
.form-group select:focus { border-color: var(--text-main); }
#eventTypeOther { margin-top: 8px; }


/* ===== MENÚ FLOTANTE INFERIOR (celulares, tablets e iPads; solo íconos, estilo Instagram) =====
   Se activa en pantallas angostas (celular) y en cualquier dispositivo táctil (tablet / iPad,
   en vertical y horizontal). En computadoras con mouse queda el menú lateral izquierdo. */
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
  /* Ya no hay botón hamburguesa: el menú queda siempre a la vista, abajo */
  .nav-burger { display: none !important; }
  #navRight:has(#btnLogout.hidden) .nav-menu { display: none; }

  .nav-menu,
  .nav-menu.open {
    display: flex;
    position: fixed;
    top: auto;
    right: auto;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(440px, calc(100% - 28px));
    min-width: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: visible;   /* anula el scroll del menú lateral */
  }

  /* Anula lo que el menú lateral de escritorio le pone a los botones */
  #navMenu #btnLogout { margin-top: 0; }
  #navMenu .btn-apple { font-weight: 700; text-transform: none; }

  /* El menú lateral ocultaba los botones del encabezado del panel; acá se necesitan:
     "Crear Nuevo Álbum" no está en el menú flotante. Agenda y Finanzas sí están, se ocultan. */
  #adminView .header-actions { display: flex; }
  #adminView .header-actions #btnAgenda,
  #adminView .header-actions #btnFinance { display: none; }

  /* Solo íconos: el texto de cada botón se oculta */
  #navMenu .btn-apple {
    flex: 1;
    width: auto;
    height: 50px;
    padding: 0;
    justify-content: center;
    gap: 0;
    font-size: 0;
    letter-spacing: 0;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--text-main);
  }
  #navMenu .btn-apple i { width: auto; font-size: 21px; }
  #navMenu .menu-desktop-only { display: none; }   /* "Crear álbum" ya tiene su botón en el panel */

  /* Sección activa resaltada */
  body:has(#adminView:not(.hidden)) #btnAdmin,
  body:has(#editView:not(.hidden)) #btnAdmin,
  body:has(#settingsView:not(.hidden)) #btnAdmin,
  body:has(#portfolioView:not(.hidden)) #menuPortfolio,
  body:has(#agendaView:not(.hidden)) #menuAgenda,
  body:has(#financeView:not(.hidden)) #menuFinance {
    background: var(--surface-alt);
  }

  /* Deja lugar para que el menú no tape el final de la página ni los avisos */
  body:has(#btnLogout:not(.hidden)):not(.client-page) {
    padding-left: 0;   /* sin el espacio reservado del menú lateral */
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
  body:has(#btnLogout:not(.hidden)):not(.client-page) .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}


/* ===== iPHONE (incluye Pro y Pro Max) Y PANTALLAS TÁCTILES ===== */

/* En horizontal, iOS agranda los textos solo: se desactiva para que se vea igual que en vertical */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Quita la espera y el zoom del doble toque en botones, links y campos (el pellizcar para ampliar sigue funcionando) */
a, button, input, select, textarea, label, .photo-item { touch-action: manipulation; }

/* iOS hace zoom al tocar un campo cuya letra mide menos de 16 px.
   Con 16 px en todos los campos de texto, la pantalla no se mueve ni se agranda al escribir. */
@media (max-width: 600px), (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
  select,
  textarea { font-size: 16px !important; }
  .pin-form input { font-size: 20px !important; }   /* el PIN conserva su tamaño grande */

  /* Textos editables del portafolio que eran más chicos */
  .pf-editing .pf-subtitle,
  .pf-editing .pf-author,
  .pf-row .pf-edit { font-size: 16px; }
}

/* Las ventanitas usan el alto realmente visible (Safari tiene barras que cambian de tamaño) */
.modal-card { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }