/* Header */
.mk-head{
    display:flex; gap:16px; align-items:center; justify-content:space-between;
    margin-bottom:16px; position:relative; z-index:5;
  }
  .mk-title{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:22px }
  .mk-emoji{ font-size:22px; line-height:1 }
  
  /* Segmented control */
  .mk-segmented{
    display:flex; gap:8px; padding:6px; border-radius:14px;
    background:rgba(255,255,255,.7); backdrop-filter:saturate(180%) blur(8px);
    border:1px solid #e5e7eb; box-shadow:0 6px 16px rgba(17,24,39,.06);
    overflow:auto; max-width:100%;
  }
  .mk-segmented .seg-item{
    display:flex; align-items:center; gap:8px; padding:8px 12px;
    border-radius:10px; color:#111; text-decoration:none; border:1px solid transparent;
    white-space:nowrap; transition:all .15s ease;
  }
  .mk-segmented .seg-item i{ font-size:16px }
  .mk-segmented .seg-item .count{
    margin-left:4px; padding:2px 8px; border-radius:999px; font-size:12px;
    background:#f3f4f6; color:#111; border:1px solid #e5e7eb;
  }
  .mk-segmented .seg-item .count-pair{
    display:flex; align-items:center; gap:8px; margin-left:6px;
    padding:2px 8px; border-radius:999px; font-size:12px;
    background:#f3f4f6; color:#111; border:1px solid #e5e7eb;
  }
  .mk-segmented .seg-item .dot{ width:8px; height:8px; border-radius:50%; display:inline-block }
  .mk-segmented .seg-item .dot.warn{ background:#f59e0b }  /* programados */
  .mk-segmented .seg-item .dot.ok{ background:#10b981 }     /* enviados */
  
  .mk-segmented .seg-item:hover{ background:#f8fafc; border-color:#e5e7eb }
  .mk-segmented .seg-item.active{
    background:#111; color:#fff; border-color:#111;
  }
  .mk-segmented .seg-item.active .count,
  .mk-segmented .seg-item.active .count-pair{
    background:#0f172a; color:#fff; border-color:transparent;
  }
  
  /* KPI cards suaves (por si las usas) */
  .kpi-card .kpi{ font-weight:800; font-size:28px; line-height:1 }
  .kpi-note{ font-size:12px; color:#6b7280 }
  .progress-mini{ height:8px; background:#f3f4f6; border-radius:999px; overflow:hidden }
  .progress-mini > span{ display:block; height:100%; background:#111; }
  
  /* Utilidades */
  .badge-soft{ padding:.25rem .5rem; border-radius:999px; font-size:12px }
  .badge-soft.green{ background:#e8f5e9; color:#137333 }
  .badge-soft.gray{  background:#f3f4f6; color:#374151 }
  .badge-soft.orange{background:#fff4e5; color:#b26a00 }
  .table-sm th,.table-sm td{ vertical-align:middle }
  .preview-box{ border:1px solid #e5e7eb; border-radius:12px; padding:12px; background:#fff }
  
  /* Mobile */
  @media (max-width: 992px){
    .mk-title{ font-size:20px }
    .mk-segmented{ width:100% }
  }
/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   PICTORIAL  Modern Design System
   Un dise�o elegante y profesional para fot�grafos
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */

/*                                                                              
   CSS Variables / Design Tokens
                                                                                 */
:root {
  /* Colores principales */
  --pt-white: #ffffff;
  --pt-black: #0a0a0a;

  /* Escala de grises */
  --pt-gray-50: #fafafa;
  --pt-gray-100: #f4f4f5;
  --pt-gray-200: #e4e4e7;
  --pt-gray-300: #d4d4d8;
  --pt-gray-400: #a1a1aa;
  --pt-gray-500: #71717a;
  --pt-gray-600: #52525b;
  --pt-gray-700: #3f3f46;
  --pt-gray-800: #27272a;
  --pt-gray-900: #18181b;

  /* Accent Colors */
  --pt-primary: #111827;
  --pt-primary-hover: #1f2937;
  --pt-accent: #3b82f6;
  --pt-accent-hover: #2563eb;
  --pt-success: #10b981;
  --pt-warning: #f59e0b;
  --pt-danger: #ef4444;

  /* Layout */
  --pt-sidebar-width: 260px;
  --pt-sidebar-collapsed: 72px;
  --pt-header-height: 64px;

  /* Spacing */
  --pt-space-1: 4px;
  --pt-space-2: 8px;
  --pt-space-3: 12px;
  --pt-space-4: 16px;
  --pt-space-5: 20px;
  --pt-space-6: 24px;
  --pt-space-8: 32px;

  /* Border Radius */
  --pt-radius-sm: 6px;
  --pt-radius: 10px;
  --pt-radius-lg: 16px;
  --pt-radius-full: 9999px;

  /* Shadows */
  --pt-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --pt-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --pt-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  --pt-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Transitions */
  --pt-transition-fast: 150ms ease;
  --pt-transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --pt-transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   RESET & BASE
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Fix for layout shift when dropdowns open - force scrollbar to always be visible */
html {
  overflow-y: scroll !important;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--pt-gray-900);
  background: var(--pt-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Prevent horizontal scroll */
  max-width: 100vw;
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   APP LAYOUT
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.pictorial-app {
  min-height: 100vh;
  display: flex;
  overflow-x: hidden; /* Prevent horizontal scroll */
  max-width: 100vw;
}

/*    SIDEBAR                                                                   */
.pictorial-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--pt-sidebar-width);
  background: var(--pt-primary);
  color: var(--pt-white);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width var(--pt-transition), transform var(--pt-transition);
}

.pictorial-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pt-space-4) var(--pt-space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: var(--pt-header-height);
}

.pictorial-sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--pt-space-3);
  text-decoration: none;
  color: var(--pt-white);
}

.pictorial-sidebar__logo-img {
  width: 36px;
  height: 36px;
  border-radius: var(--pt-radius-sm);
  object-fit: contain;
}

.pictorial-sidebar__logo-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.pictorial-sidebar__toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--pt-radius-sm);
  color: var(--pt-white);
  cursor: pointer;
  transition: background var(--pt-transition-fast);
}

.pictorial-sidebar__toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pictorial-sidebar__nav {
  flex: 1;
  padding: var(--pt-space-4) 0;
  overflow-y: auto;
}

.pictorial-nav {
  list-style: none;
  margin: 0;
  padding: 0 var(--pt-space-3);
}

.pictorial-nav__item {
  margin-bottom: var(--pt-space-1);
}

.pictorial-nav__link {
  display: flex;
  align-items: center;
  gap: var(--pt-space-3);
  padding: var(--pt-space-3) var(--pt-space-4);
  border-radius: var(--pt-radius);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--pt-transition-fast);
}

.pictorial-nav__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--pt-white);
}

.pictorial-nav__link.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--pt-white);
  font-weight: 600;
}

.pictorial-nav__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pictorial-nav__text {
  white-space: nowrap;
  overflow: hidden;
}

.pictorial-sidebar__footer {
  padding: var(--pt-space-4) var(--pt-space-5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pictorial-sidebar__version {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/*    OVERLAY                                                                   */
.pictorial-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none; /* CRITICAL: Don't block clicks when hidden */
  transition: opacity var(--pt-transition);
}

.pictorial-overlay.is-visible {
  opacity: 1;
  pointer-events: auto; /* Allow clicks only when visible */
}

/*    MAIN                                                                   */
.pictorial-main {
  flex: 1;
  margin-left: var(--pt-sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--pt-transition);
  overflow-x: hidden;
  max-width: 100%;
}

@media (max-width: 1023px) {
  .pictorial-main {
    margin-left: 0;
    max-width: 100vw;
  }
}

/*    HEADER                                                                   */
.pictorial-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--pt-space-4);
  padding: 0 var(--pt-space-6);
  height: var(--pt-header-height);
  background: var(--pt-white);
  border-bottom: 1px solid var(--pt-gray-200);
}

.pictorial-header__left {
  display: flex;
  align-items: center;
}

.pictorial-header__menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--pt-radius);
  color: var(--pt-gray-700);
  cursor: pointer;
  transition: background var(--pt-transition-fast);
}

.pictorial-header__menu-btn:hover {
  background: var(--pt-gray-100);
}

.pictorial-header__center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.pictorial-search {
  display: flex;
  align-items: center;
  gap: var(--pt-space-2);
  width: 100%;
  max-width: 400px;
  padding: var(--pt-space-2) var(--pt-space-4);
  background: var(--pt-gray-100);
  border: 1px solid transparent;
  border-radius: var(--pt-radius-full);
  transition: all var(--pt-transition-fast);
}

.pictorial-search:focus-within {
  background: var(--pt-white);
  border-color: var(--pt-gray-300);
  box-shadow: var(--pt-shadow);
}

.pictorial-search svg {
  color: var(--pt-gray-400);
  flex-shrink: 0;
}

.pictorial-search__input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--pt-gray-900);
  outline: none;
}

.pictorial-search__input::placeholder {
  color: var(--pt-gray-400);
}

.pictorial-header__right {
  display: flex;
  align-items: center;
  gap: var(--pt-space-2);
}

.pictorial-header__icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--pt-radius);
  color: var(--pt-gray-600);
  cursor: pointer;
  transition: all var(--pt-transition-fast);
}

.pictorial-header__icon-btn:hover {
  background: var(--pt-gray-100);
  color: var(--pt-gray-900);
}

.pictorial-header__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--pt-danger);
  border-radius: var(--pt-radius-full);
  font-size: 11px;
  font-weight: 700;
  color: var(--pt-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pictorial-header__user-btn {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: var(--pt-space-1);
  border-radius: var(--pt-radius-full);
  cursor: pointer;
  transition: all var(--pt-transition-fast);
}

.pictorial-header__user-btn:hover {
  background: var(--pt-gray-100);
}

.pictorial-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--pt-radius-full);
  object-fit: cover;
}

/*    DROPDOWN                                                                   */
.pictorial-dropdown {
  position: relative;
}

.pictorial-dropdown__menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: var(--pt-space-2);
  min-width: 280px;
  background: var(--pt-white);
  border: 1px solid var(--pt-gray-200);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--pt-transition-fast);
  z-index: 1000;
}

.pictorial-dropdown__menu--right {
  left: auto;
  right: 0;
}

.pictorial-dropdown__menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pictorial-dropdown__header {
  padding: var(--pt-space-4);
  border-bottom: 1px solid var(--pt-gray-100);
}

.pictorial-dropdown__header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--pt-gray-900);
}

.pictorial-dropdown__body {
  padding: var(--pt-space-2);
  max-height: 300px;
  overflow-y: auto;
}

.pictorial-dropdown__footer {
  padding: var(--pt-space-3) var(--pt-space-4);
  border-top: 1px solid var(--pt-gray-100);
  text-align: center;
}

.pictorial-dropdown__footer a {
  font-size: 13px;
  font-weight: 600;
  color: var(--pt-accent);
  text-decoration: none;
}

.pictorial-dropdown__footer a:hover {
  text-decoration: underline;
}

.pictorial-dropdown__user-info {
  padding: var(--pt-space-4);
  border-bottom: 1px solid var(--pt-gray-100);
}

.pictorial-dropdown__user-info strong {
  display: block;
  font-size: 15px;
  color: var(--pt-gray-900);
}

.pictorial-dropdown__user-info span {
  display: block;
  font-size: 13px;
  color: var(--pt-gray-500);
  margin-top: 2px;
}

.pictorial-dropdown__divider {
  height: 1px;
  background: var(--pt-gray-100);
  margin: var(--pt-space-2) 0;
}

.pictorial-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--pt-space-3);
  padding: var(--pt-space-3) var(--pt-space-4);
  border-radius: var(--pt-radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--pt-gray-700);
  text-decoration: none;
  transition: all var(--pt-transition-fast);
}

.pictorial-dropdown__item:hover {
  background: var(--pt-gray-50);
  color: var(--pt-gray-900);
}

.pictorial-dropdown__item--danger {
  color: var(--pt-danger);
}

.pictorial-dropdown__item--danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--pt-danger);
}

/*    NOTIFICATION                                                               */
.pictorial-notif {
  display: flex;
  gap: var(--pt-space-3);
  padding: var(--pt-space-3);
  border-radius: var(--pt-radius);
  transition: background var(--pt-transition-fast);
}

.pictorial-notif:hover {
  background: var(--pt-gray-50);
}

.pictorial-notif__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pt-gray-100);
  border-radius: var(--pt-radius);
  color: var(--pt-gray-600);
  flex-shrink: 0;
}

.pictorial-notif__icon--info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--pt-accent);
}

.pictorial-notif__content {
  flex: 1;
  min-width: 0;
}

.pictorial-notif__content p {
  margin: 0;
  font-size: 13px;
  color: var(--pt-gray-700);
  line-height: 1.4;
}

.pictorial-notif__time {
  display: block;
  font-size: 12px;
  color: var(--pt-gray-400);
  margin-top: 4px;
}

/*    CONTENT                                                                   */
.pictorial-content {
  flex: 1;
  padding: var(--pt-space-6);
  width: 100%;
  max-width: 100%;
}

/*    FOOTER                                                                   */
.pictorial-footer {
  padding: var(--pt-space-6);
  text-align: center;
  color: var(--pt-gray-500);
  font-size: 13px;
  border-top: 1px solid var(--pt-gray-200);
  background: var(--pt-white);
}

.pictorial-footer p {
  margin: 0;
}

.pictorial-footer a {
  color: var(--pt-accent);
  text-decoration: none;
}

.pictorial-footer a:hover {
  text-decoration: underline;
}

.pictorial-footer__heart {
  color: #ef4444;
}

/*    ALERTS                                                                   */
.pictorial-alert {
  display: flex;
  align-items: center;
  gap: var(--pt-space-3);
  padding: var(--pt-space-4) var(--pt-space-5);
  border-radius: var(--pt-radius);
  margin-bottom: var(--pt-space-5);
  font-size: 14px;
  font-weight: 500;
}

.pictorial-alert--success {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pictorial-alert--error {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   SIDEBAR COLLAPSED STATE
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
@media (min-width: 1024px) {
  .pictorial-sidebar__toggle {
    display: flex;
  }

  [data-sidebar-collapsed="true"] .pictorial-sidebar {
    width: var(--pt-sidebar-collapsed);
  }

  [data-sidebar-collapsed="true"] .pictorial-sidebar__logo-text,
  [data-sidebar-collapsed="true"] .pictorial-nav__text,
  [data-sidebar-collapsed="true"] .pictorial-sidebar__version {
    display: none;
  }

  [data-sidebar-collapsed="true"] .pictorial-sidebar__header {
    justify-content: center;
    padding: var(--pt-space-4) var(--pt-space-3);
  }

  [data-sidebar-collapsed="true"] .pictorial-nav {
    padding: 0 var(--pt-space-2);
  }

  [data-sidebar-collapsed="true"] .pictorial-nav__link {
    justify-content: center;
    padding: var(--pt-space-3);
  }

  [data-sidebar-collapsed="true"] .pictorial-main {
    margin-left: var(--pt-sidebar-collapsed);
  }
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   RESPONSIVE - MOBILE
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
@media (max-width: 1023px) {
  .pictorial-sidebar {
    transform: translateX(-100%);
  }

  .pictorial-sidebar.is-open {
    transform: translateX(0);
  }

  .pictorial-overlay {
    display: block;
  }

  .pictorial-main {
    margin-left: 0;
  }

  .pictorial-header__menu-btn {
    display: flex;
  }

  .pictorial-header {
    padding: 0 var(--pt-space-4);
  }

  .pictorial-content {
    padding: var(--pt-space-4);
  }

  .pictorial-search {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .pictorial-header__center {
    display: none;
  }

  .pictorial-content {
    padding: var(--pt-space-3);
  }
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   ADMIN PAGE COMPONENTS
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.admin-page {
  max-width: 1200px;
  margin: 0 auto;
}

.admin-page__header {
  margin-bottom: var(--pt-space-6);
}

.admin-page__breadcrumb {
  margin-bottom: var(--pt-space-4);
}

.admin-breadcrumb__link {
  display: inline-flex;
  align-items: center;
  gap: var(--pt-space-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--pt-gray-600);
  text-decoration: none;
  transition: color var(--pt-transition-fast);
}

.admin-breadcrumb__link:hover {
  color: var(--pt-gray-900);
}

.admin-page__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--pt-gray-900);
  letter-spacing: -0.5px;
}

.admin-page__subtitle {
  margin: var(--pt-space-2) 0 0;
  font-size: 15px;
  color: var(--pt-gray-500);
}

.admin-page__footer {
  margin-top: var(--pt-space-6);
  padding-top: var(--pt-space-4);
  border-top: 1px solid var(--pt-gray-200);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: var(--pt-space-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--pt-accent);
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   CARDS
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.card {
  background: var(--pt-white);
  border: 1px solid var(--pt-gray-200);
  border-radius: var(--pt-radius-lg);
  box-shadow: var(--pt-shadow-sm);
}

.card-header {
  padding: var(--pt-space-5);
  border-bottom: 1px solid var(--pt-gray-100);
}

.card-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--pt-gray-900);
}

.card-body {
  padding: var(--pt-space-5);
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   FORMS
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.form-label {
  display: block;
  margin-bottom: var(--pt-space-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--pt-gray-700);
}

.form-control {
  display: block;
  width: 100%;
  padding: var(--pt-space-3) var(--pt-space-4);
  font-size: 14px;
  color: var(--pt-gray-900);
  background: var(--pt-white);
  border: 1px solid var(--pt-gray-300);
  border-radius: var(--pt-radius);
  transition: all var(--pt-transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--pt-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder {
  color: var(--pt-gray-400);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   BUTTONS
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--pt-space-2);
  padding: var(--pt-space-3) var(--pt-space-5);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--pt-radius);
  border: none;
  cursor: pointer;
  transition: all var(--pt-transition-fast);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--pt-primary);
  color: var(--pt-white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--pt-primary-hover);
}

.btn-secondary {
  background: var(--pt-gray-100);
  color: var(--pt-gray-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--pt-gray-200);
  color: var(--pt-gray-900);
}

.btn-warning {
  background: #fef3c7;
  color: #92400e;
}

.btn-warning:hover:not(:disabled) {
  background: #fde68a;
}

.btn-danger {
  background: var(--pt-danger);
  color: var(--pt-white);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-info {
  background: #dbeafe;
  color: #1e40af;
}

.btn-info:hover:not(:disabled) {
  background: #bfdbfe;
}

.btn-lg {
  padding: var(--pt-space-4) var(--pt-space-6);
  font-size: 15px;
}

.app-btn-primary {
  background: var(--pt-primary);
  color: var(--pt-white) !important;
}

.app-btn-primary:hover {
  background: var(--pt-primary-hover);
}

.app-btn-secondary {
  background: var(--pt-gray-100);
  color: var(--pt-gray-700);
}

.app-btn-secondary:hover {
  background: var(--pt-gray-200);
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   ALERTS (Bootstrap Compatibility)
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.alert {
  padding: var(--pt-space-4) var(--pt-space-5);
  border-radius: var(--pt-radius);
  margin-bottom: var(--pt-space-4);
  font-size: 14px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #1e40af;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   BADGES
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--pt-radius-full);
}

.bg-primary { background: var(--pt-primary) !important; color: var(--pt-white) !important; }
.bg-secondary { background: var(--pt-gray-500) !important; color: var(--pt-white) !important; }
.bg-success { background: var(--pt-success) !important; color: var(--pt-white) !important; }
.bg-danger { background: var(--pt-danger) !important; color: var(--pt-white) !important; }
.bg-warning { background: var(--pt-warning) !important; color: #fff !important; }
.bg-info { background: var(--pt-accent) !important; color: var(--pt-white) !important; }
.bg-dark { background: var(--pt-gray-800) !important; color: var(--pt-white) !important; }

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   TABLES
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: var(--pt-space-4);
  text-align: left;
  border-bottom: 1px solid var(--pt-gray-200);
}

.table th {
  font-size: 13px;
  font-weight: 600;
  color: var(--pt-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--pt-gray-50);
}

.table tbody tr:hover { background: var(--pt-gray-50); }

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   UTILITY CLASSES
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.text-muted { color: var(--pt-gray-500) !important; }
.text-center { text-align: center !important; }
.text-white { color: var(--pt-white) !important; }
.text-dark { color: var(--pt-gray-800) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--pt-space-1) !important; }
.mb-2 { margin-bottom: var(--pt-space-2) !important; }
.mb-3 { margin-bottom: var(--pt-space-3) !important; }
.mb-4 { margin-bottom: var(--pt-space-4) !important; }

.mt-2 { margin-top: var(--pt-space-2) !important; }
.mt-3 { margin-top: var(--pt-space-3) !important; }
.mt-auto { margin-top: auto !important; }

.p-3 { padding: var(--pt-space-3) !important; }
.p-4 { padding: var(--pt-space-4) !important; }
.px-4 { padding-left: var(--pt-space-4) !important; padding-right: var(--pt-space-4) !important; }
.py-3 { padding-top: var(--pt-space-3) !important; padding-bottom: var(--pt-space-3) !important; }

.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }

.flex-column { flex-direction: column !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.flex-wrap { flex-wrap: wrap !important; }

.gap-2 { gap: var(--pt-space-2) !important; }
.gap-3 { gap: var(--pt-space-3) !important; }

.w-100 { width: 100% !important; }

.border-bottom { border-bottom: 1px solid var(--pt-gray-200) !important; }
.border-top { border-top: 1px solid var(--pt-gray-200) !important; }

.rounded { border-radius: var(--pt-radius) !important; }

.shadow-sm { box-shadow: var(--pt-shadow-sm) !important; }

.img-fluid { max-width: 100%; height: auto; }

.position-absolute { position: absolute !important; }
.position-relative { position: relative !important; }
.top-0 { top: 0 !important; }
.start-0 { left: 0 !important; }

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   GRID SYSTEM (Bootstrap Compatibility)
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.container-xl {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--pt-space-4);
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(-1 * var(--pt-space-3));
}

.col, [class*="col-"] {
  flex: 1;
  padding: 0 var(--pt-space-3);
}

.col-auto { flex: 0 0 auto; width: auto; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 768px) {
  .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 992px) {
  .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
}

.gy-4 > * { margin-bottom: var(--pt-space-4); }

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   HERO TITLE FIX - WHITE TEXT
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.pg-hero__title {
  color: #ffffff !important;
}

.pg-hero__content {
  color: #ffffff;
}

.pg-hero__description {
  color: rgba(255, 255, 255, 0.85);
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   AUTH PAGES (Login, Register, Password Recovery)
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.app-login,
.app-signup,
.app-reset-password {
  min-height: 100vh;
  background: var(--pt-gray-50);
}

.app-auth-wrapper {
  min-height: 100vh;
}

.auth-main-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--pt-white);
}

.auth-background-col {
  position: relative;
  display: none;
  min-height: 100vh;
  overflow: hidden;
}

@media (min-width: 768px) {
  .auth-background-col {
    display: block;
  }
}

.auth-background-col img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-background-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.7) 0%, rgba(17, 24, 39, 0.5) 100%);
}

.auth-background-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 1;
}

.overlay-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--pt-white);
}

.overlay-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--pt-white);
  margin-bottom: 8px;
}

.overlay-content div {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.app-auth-body {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.app-auth-branding {
  text-align: center;
}

.app-auth-branding img {
  height: 50px;
  width: auto;
}

.auth-heading {
  font-size: 28px;
  font-weight: 800;
  color: var(--pt-gray-900);
  letter-spacing: -0.5px;
  margin-bottom: 32px;
}

.auth-intro {
  font-size: 15px;
  color: var(--pt-gray-500);
  line-height: 1.5;
}

.auth-form-container {
  margin-top: 24px;
}

.auth-form-container .form-control {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--pt-gray-900);
  background: var(--pt-gray-50);
  border: 1px solid var(--pt-gray-200);
  border-radius: var(--pt-radius);
  transition: all var(--pt-transition-fast);
}

.auth-form-container .form-control:focus {
  outline: none;
  background: var(--pt-white);
  border-color: var(--pt-accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.auth-form-container .form-control::placeholder {
  color: var(--pt-gray-400);
}

.auth-form-container .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-form-container .form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--pt-gray-300);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--pt-primary);
}

.auth-form-container .form-check-label {
  font-size: 14px;
  color: var(--pt-gray-600);
  cursor: pointer;
}

.auth-form-container .forgot-password a {
  font-size: 14px;
  color: var(--pt-accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-form-container .forgot-password a:hover {
  text-decoration: underline;
}

.auth-form-container .btn.app-btn-primary,
.auth-form-container .btn.theme-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  color: var(--pt-white);
  background: var(--pt-primary);
  border: none;
  border-radius: var(--pt-radius);
  cursor: pointer;
  transition: all var(--pt-transition-fast);
  margin-top: 16px;
}

.auth-form-container .btn.app-btn-primary:hover,
.auth-form-container .btn.theme-btn:hover {
  background: var(--pt-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.2);
}

.auth-option {
  margin-top: 24px;
  font-size: 14px;
  color: var(--pt-gray-500);
}

.auth-option .text-link {
  color: var(--pt-accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-option .text-link:hover {
  text-decoration: underline;
}

.app-auth-footer {
  margin-top: auto;
  padding: 24px 0;
}

.app-auth-footer .copyright {
  font-size: 13px;
  color: var(--pt-gray-400);
}

.app-auth-footer .app-link {
  color: var(--pt-accent);
  text-decoration: none;
}

.app-auth-footer .app-link:hover {
  text-decoration: underline;
}

/* Devise shared links */
.auth-form-container + div a,
.auth-form-container ~ a {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  color: var(--pt-gray-500);
  text-decoration: none;
}

.auth-form-container + div a:hover,
.auth-form-container ~ a:hover {
  color: var(--pt-accent);
}

/* sr-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Extra row/col utilities for auth */
.g-0 {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}

.g-0 > * {
  padding-right: 0;
  padding-left: 0;
}

.p-0 { padding: 0 !important; }
.p-5 { padding: 48px !important; }
.p-lg-5 { padding: 48px !important; }

.h-100 { height: 100% !important; }

.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.text-start { text-align: left !important; }
.text-left { text-align: left !important; }
.text-end { text-align: right !important; }

.align-content-end { align-content: flex-end !important; }

@media (max-width: 767px) {
  .p-5 { padding: 24px !important; }
  .auth-heading { font-size: 24px; }
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   DROPDOWN FIX - Better positioning and visibility
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */
.pictorial-dropdown {
  position: relative;
  z-index: 1001;
}

.pictorial-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 320px;
  max-width: 380px;
  background: var(--pt-white);
  border: 1px solid var(--pt-gray-200);
  border-radius: var(--pt-radius-lg);
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.15), 0 8px 16px -4px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1002;
  overflow: hidden;
}

.pictorial-dropdown__menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* First dropdown (notifications) align left */
.pictorial-header__right > .pictorial-dropdown:first-child .pictorial-dropdown__menu {
  right: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.98);
  transform-origin: top center;
}

.pictorial-header__right > .pictorial-dropdown:first-child .pictorial-dropdown__menu.is-open {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* User dropdown stays right-aligned */
.pictorial-dropdown__menu--right {
  right: 0;
  left: auto;
  min-width: 240px;
}

/* Improved dropdown header */
.pictorial-dropdown__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--pt-gray-100);
  background: var(--pt-gray-50);
}

.pictorial-dropdown__header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--pt-gray-900);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Improved notification items */
.pictorial-notif {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 0;
  transition: background var(--pt-transition-fast);
  border-bottom: 1px solid var(--pt-gray-50);
}

.pictorial-notif:last-child {
  border-bottom: none;
}

.pictorial-notif:hover {
  background: var(--pt-gray-50);
}

.pictorial-notif__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pt-gray-100);
  border-radius: var(--pt-radius);
  color: var(--pt-gray-600);
  flex-shrink: 0;
}

.pictorial-notif__icon--info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--pt-accent);
}

.pictorial-notif__content p {
  margin: 0;
  font-size: 14px;
  color: var(--pt-gray-700);
  line-height: 1.5;
}

.pictorial-notif__time {
  display: block;
  font-size: 12px;
  color: var(--pt-gray-400);
  margin-top: 6px;
}

/* Dropdown footer */
.pictorial-dropdown__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--pt-gray-100);
  text-align: center;
  background: var(--pt-gray-50);
}

.pictorial-dropdown__footer a {
  font-size: 14px;
  font-weight: 600;
  color: var(--pt-accent);
  text-decoration: none;
}

.pictorial-dropdown__footer a:hover {
  text-decoration: underline;
}

/* Responsive dropdown */
@media (max-width: 640px) {
  .pictorial-dropdown__menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    min-width: 100%;
    max-width: 100%;
    border-radius: var(--pt-radius-lg) var(--pt-radius-lg) 0 0;
    transform: translateY(100%);
    max-height: 70vh;
    overflow-y: auto;
  }

  .pictorial-dropdown__menu.is-open {
    transform: translateY(0);
  }

  .pictorial-header__right > .pictorial-dropdown:first-child .pictorial-dropdown__menu {
    transform: translateY(100%);
  }

  .pictorial-header__right > .pictorial-dropdown:first-child .pictorial-dropdown__menu.is-open {
    transform: translateY(0);
  }
}

/* PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
   MOBILE TOUCH OPTIMIZATIONS
   Critical fixes for mobile interactivity
   PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP */

/* Remove tap highlight on all interactive elements */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Enable smooth scrolling on mobile */
html {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Improve touch responsiveness for all buttons and links */
button,
a,
[role="button"],
[data-action],
.pictorial-nav__link,
.pg-card__link,
.pg-card__fav,
.pg-action-btn,
.pg-tab {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

/* Allow text selection in content areas */
p, span, div:not([role="button"]) {
  -webkit-user-select: text;
  user-select: text;
}

/* Improve sidebar touch responsiveness */
.pictorial-sidebar,
.pictorial-overlay {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* Better touch targets for mobile menu */
@media (max-width: 1023px) {
  /* Increase tap target size for mobile menu button */
  .pictorial-header__menu-btn {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
  }

  /* Improve nav links touch targets */
  .pictorial-nav__link {
    min-height: 48px;
    padding: 14px 16px;
  }

  /* Better touch for sidebar toggle */
  .pictorial-sidebar__toggle {
    min-width: 44px;
    min-height: 44px;
  }

  /* Improve header icon buttons */
  .pictorial-header__icon-btn,
  .pictorial-header__user-btn {
    min-width: 48px;
    min-height: 48px;
  }

  /* Make sidebar easier to swipe */
  .pictorial-sidebar.is-open {
    touch-action: pan-y;
  }

  /* Prevent body scroll when sidebar is open */
  body:has(.pictorial-sidebar.is-open) {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  /* Improve overlay touch area */
  .pictorial-overlay.is-visible {
    display: block;
    touch-action: none;
  }
}

/* Gallery mobile touch optimizations */
@media (max-width: 768px) {
  /* Improve card link touch area */
  .pg-card__link {
    display: block;
    touch-action: manipulation;
    -webkit-user-drag: none;
  }

  /* Better favorite button touch target */
  .pg-card__fav {
    min-width: 48px;
    min-height: 48px;
    top: 8px;
    right: 8px;
    opacity: 1 !important; /* Always visible on mobile */
    transform: scale(1) !important;
  }

  /* Improve tab touch targets */
  .pg-tab {
    min-height: 44px;
    padding: 12px 20px;
  }

  /* Better action buttons */
  .pg-action-btn {
    min-height: 44px;
    padding: 12px 16px;
  }

  /* Lightbox controls - bigger touch targets */
  .pg-lightbox__close {
    width: 56px;
    height: 56px;
    top: 12px;
    right: 12px;
  }

  .pg-lightbox__nav {
    width: 64px;
    height: 64px;
  }

  .pg-lightbox__nav--prev {
    left: 8px;
  }

  .pg-lightbox__nav--next {
    right: 8px;
  }

  /* Prevent image dragging in lightbox */
  .pg-lightbox__img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
  }

  /* Better download button in lightbox */
  .pg-lightbox__download {
    min-height: 48px;
    padding: 14px 24px;
  }
}

/* Prevent double-tap zoom on buttons */
button,
a,
[role="button"] {
  touch-action: manipulation;
}

/* Improve form controls on mobile */
@media (max-width: 768px) {
  select.form-control,
  .pg-sort select {
    min-height: 44px;
    padding: 12px 40px 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  input.form-control,
  textarea.form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px;
  }
}

/* Fix for iOS Safari bottom bar */
@supports (-webkit-touch-callout: none) {
  .pictorial-main {
    min-height: -webkit-fill-available;
  }

  .pg-lightbox__container {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* Smooth transitions for mobile interactions */
@media (max-width: 1023px) {
  .pictorial-sidebar,
  .pictorial-overlay,
  .pictorial-dropdown__menu {
    will-change: transform, opacity;
  }
}

/* Prevent text selection during touch interactions */
.pictorial-sidebar.is-open *,
.pg-lightbox.is-open *,
.pictorial-dropdown__menu.is-open * {
  -webkit-user-select: none;
  user-select: none;
}

/* Allow text selection in specific areas */
.pictorial-notif__content,
.pg-card__name,
.pg-lightbox__filename {
  -webkit-user-select: text;
  user-select: text;
}

/* Improve dropdown touch on mobile */
@media (max-width: 640px) {
  .pictorial-dropdown__item {
    min-height: 48px;
    padding: 14px 20px;
  }

  .pictorial-notif {
    padding: 16px 20px;
  }
}
/*




*/

/* ══════════════════════════════════════════════════════════════════════════════
   PICTORIAL — Professional Photography Gallery Styles
   Diseño de clase mundial para fotógrafos profesionales
   ══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   Global Layout Fixes
   ───────────────────────────────────────────────────────────────────────────── */
/* Force scrollbar to always be visible to prevent layout shift when dropdowns open */
html {
  overflow-y: scroll !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CSS Variables / Design Tokens
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Colores */
  --pg-white: #ffffff;
  --pg-black: #0a0a0a;
  --pg-gray-50: #fafafa;
  --pg-gray-100: #f4f4f5;
  --pg-gray-200: #e4e4e7;
  --pg-gray-300: #d4d4d8;
  --pg-gray-400: #a1a1aa;
  --pg-gray-500: #71717a;
  --pg-gray-600: #52525b;
  --pg-gray-700: #3f3f46;
  --pg-gray-800: #27272a;
  --pg-gray-900: #18181b;

  /* Accent */
  --pg-primary: #111827;
  --pg-primary-hover: #1f2937;
  --pg-accent: #f43f5e;
  --pg-accent-light: #fecdd3;

  /* Espaciado */
  --pg-gap: 12px;
  --pg-gap-lg: 20px;
  --pg-radius: 12px;
  --pg-radius-sm: 8px;
  --pg-radius-full: 999px;

  /* Compatibilidad con estilos anteriores */
  --pg-border: #e4e4e7;
  --pg-muted: #71717a;

  /* Transiciones */
  --pg-transition-fast: 150ms ease;
  --pg-transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --pg-transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Sombras */
  --pg-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --pg-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --pg-shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --pg-shadow-lg: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ─────────────────────────────────────────────────────────────────────────────
   ActiveStorage Direct Uploads
   ───────────────────────────────────────────────────────────────────────────── */
.direct-upload{display:inline-block;position:relative;padding:2px 4px;margin:0 3px 3px 0;border:1px solid rgba(0,0,0,.3);border-radius:3px;font-size:11px;line-height:13px}
.direct-upload--pending{opacity:.6}
.direct-upload__progress{position:absolute;top:0;left:0;bottom:0;opacity:.2;background:#0076ff;transition:width 120ms ease-out,opacity 60ms 60ms ease-in;transform:translate3d(0,0,0)}
.direct-upload--complete .direct-upload__progress{opacity:.4}
.direct-upload--error{border-color:red}
input[type=file][data-direct-upload-url][disabled]{display:none}

/* ─────────────────────────────────────────────────────────────────────────────
   Marketing / Dashboard Utils
   ───────────────────────────────────────────────────────────────────────────── */
.marketing-header{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.marketing-actions{margin-left:auto}
.kpi-card .kpi{font-size:28px;font-weight:800}
.kpi-card small{color:#6c757d}
.table thead th{position:sticky;top:0;background:#fff;z-index:1}
.badge-dot{display:inline-flex;align-items:center;gap:6px}
.badge-dot::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;display:inline-block}
.preview-box{background:#0f172a;color:#e2e8f0;border-radius:10px;padding:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;white-space:pre-wrap}
.card-toolbar{display:flex;gap:8px;align-items:center}
.sticky-actions{position:sticky;bottom:0;background:#fff;padding:10px;border-top:1px solid #eee}
.table-sm td,.table-sm th{padding:.5rem .75rem}

/* ══════════════════════════════════════════════════════════════════════════════
   PICTORIAL GALLERY — HERO SECTION
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-hero {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  border-radius: var(--pg-radius);
  overflow: hidden;
  background: var(--pg-gray-900);
}

@media (max-width: 768px) {
  .pg-hero {
    border-radius: 0; /* No border radius on mobile for full width */
    margin: 0;
    max-width: 100%;
  }
}

.pg-hero__cover {
  position: relative;
  width: 100%;
  height: 380px;
}

.pg-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pg-hero__gradient {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.pg-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
}

.pg-hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 40px;
  color: var(--pg-white);
}

@media (max-width: 768px) {
  .pg-hero__content {
    padding: 20px 16px;
  }
}

@media (max-width: 500px) {
  .pg-hero__content {
    padding: 16px 12px;
  }
}

.pg-hero__badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pg-hero__badge-row::-webkit-scrollbar {
  display: none;
}

@media (max-width: 500px) {
  .pg-hero__badge-row {
    gap: 6px;
    margin-bottom: 12px;
  }
}

.pg-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--pg-radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--pg-white);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 500px) {
  .pg-hero__badge {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
  }

  .pg-hero__badge svg {
    width: 14px;
    height: 14px;
  }
}

.pg-hero__badge svg {
  opacity: 0.85;
}

.pg-hero__badge--primary {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
}

.pg-hero__title {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 500px) {
  .pg-hero__title {
    font-size: 22px;
    line-height: 1.2;
  }
}

.pg-hero__description {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  opacity: 0.85;
  max-width: 600px;
  line-height: 1.5;
}

/* Compatibilidad con Hero anterior */
.pg-hero__shade{position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,.2),rgba(0,0,0,.45))}
.pg-hero__placeholder{display:grid;place-items:center;height:320px;background:#111827;color:#e5e7eb;font-weight:800;font-size:42px}
.pg-hero__body{position:absolute; inset:auto 0 0 0; padding:18px 22px; color:#fff}
.pg-hero__meta{display:flex;gap:8px;flex-wrap:wrap}
.pg-badge{background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.22); color:#fff; padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700}

@media (max-width: 768px) {
  .pg-hero__cover { height: 300px; }
  .pg-hero__content { padding: 24px 20px; }
  .pg-hero__badge { padding: 6px 12px; font-size: 12px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   GALLERY SECTION
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-section {
  padding: 24px 0 48px;
}

.pg-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (max-width: 768px) {
  .pg-container {
    padding: 0 12px;
  }
}

@media (max-width: 500px) {
  .pg-container {
    padding: 0 8px;
  }
}

/* Compatibilidad */
.pg-wrap{width:min(1200px,100%); margin:18px auto 0; padding:0 2px}
.pg-sections{width:min(1200px,100%); margin:12px auto 0}
.pg-h2{
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size:22px; font-weight:800; letter-spacing:-.01em; color:#0f172a;
  margin:4px 4px 12px;
}

.pg-section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--pg-gray-900);
}

.pg-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--pg-gray-500);
  padding: 4px 12px;
  background: var(--pg-gray-100);
  border-radius: var(--pg-radius-full);
}

/* ── Toolbar Sticky ───────────────────────────────────────────────────────── */
.pg-toolbar {
  position: sticky;
  top: 16px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius);
  box-shadow: var(--pg-shadow-md);
  max-width: 100%;
  overflow: visible;
}

@media (max-width: 768px) {
  .pg-toolbar {
    position: relative;
    top: auto;
    padding: 10px 8px;
    margin-bottom: 16px;
    gap: 8px;
  }
}

.pg-toolbar--static {
  position: relative;
  top: auto;
  background: var(--pg-white);
  backdrop-filter: none;
}

.pg-toolbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pg-toolbar__left::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .pg-toolbar__left {
    gap: 8px;
  }
}

.pg-toolbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Compatibilidad */
.pg-tools{display:flex;align-items:center;gap:10px}
.pg-bulk { display:flex; gap:8px; align-items:center; flex-wrap:wrap }
.pg-btn{
  appearance:none; border:1px solid #e5e7eb; background:#fff; color:#111;
  border-radius:10px; padding:9px 12px; font-weight:700; cursor:pointer;
}
.pg-btn[disabled]{ opacity:.5; cursor:not-allowed }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.pg-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px;
  max-width: 100%;
}

.pg-tabs::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .pg-tabs {
    gap: 6px;
    padding: 1px;
  }
}

.pg-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--pg-gray-50);
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--pg-gray-700);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--pg-transition-fast);
}

.pg-tab:hover {
  background: var(--pg-gray-100);
  border-color: var(--pg-gray-300);
  transform: translateY(-1px);
}

.pg-tab.is-active {
  background: var(--pg-primary);
  border-color: var(--pg-primary);
  color: var(--pg-white);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.25);
}

/* ── Actions ───────────────────────────────────────────────────────────────── */
.pg-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pg-action-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--pg-white);
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--pg-gray-700);
  cursor: pointer;
  transition: all var(--pg-transition-fast);
}

.pg-action-btn:hover:not([disabled]) {
  background: var(--pg-gray-50);
  border-color: var(--pg-gray-300);
}

.pg-action-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.pg-action-btn--primary {
  background: var(--pg-primary);
  border-color: var(--pg-primary);
  color: var(--pg-white);
}

.pg-action-btn--primary:hover:not([disabled]) {
  background: var(--pg-primary-hover);
  border-color: var(--pg-primary-hover);
}

.pg-action-btn--fav {
  color: var(--pg-gray-400);
}

.pg-action-btn--fav.has-items,
.pg-action-btn--fav:hover:not([disabled]) {
  color: var(--pg-accent);
  border-color: var(--pg-accent-light);
  background: rgba(244, 63, 94, 0.05);
}

.pg-action-btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.pg-action-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pg-action-text {
  display: none;
}

@media (min-width: 768px) {
  .pg-action-text { display: inline; }
}

/* ── Sort ───────────────────────────────────────────────────────────────── */
.pg-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pg-sort select {
  appearance: none;
  padding: 10px 36px 10px 14px;
  background: var(--pg-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--pg-gray-700);
  cursor: pointer;
  transition: all var(--pg-transition-fast);
}

.pg-sort select:hover {
  border-color: var(--pg-gray-300);
}

.pg-sort select:focus {
  outline: none;
  border-color: var(--pg-primary);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

/* ══════════════════════════════════════════════════════════════════════════════
   MASONRY GRID - Uniform Aspect Ratio (Professional Look)
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pg-gap);
}

@media (max-width: 1200px) { .pg-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .pg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .pg-grid { grid-template-columns: repeat(1, 1fr); } }

/* ── Card ───────────────────────────────────────────────────────────────── */
.pg-card {
  position: relative;
  display: block;
  border-radius: var(--pg-radius-sm);
  overflow: hidden;
  background: var(--pg-gray-100);
  transition: transform var(--pg-transition), box-shadow var(--pg-transition);
}

.pg-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pg-shadow-lg);
}

.pg-card__link {
  display: block;
  text-decoration: none;
  cursor: zoom-in;
}

.pg-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--pg-gray-100);
  overflow: hidden;
}

.pg-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity var(--pg-transition-slow), transform var(--pg-transition);
}

.pg-card__img.is-loaded {
  opacity: 1;
}

.pg-card:hover .pg-card__img {
  transform: scale(1.03);
}

/* Compatibilidad con pg-img */
.pg-img{display:block; width:100%; height:auto; border-radius:0; background:#f3f4f6}

/* Favorite Button */
.pg-card__fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: var(--pg-radius-full);
  cursor: pointer;
  color: var(--pg-gray-300);
  box-shadow: var(--pg-shadow-md);
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--pg-transition);
  z-index: 10;
}

.pg-card:hover .pg-card__fav,
.pg-card__fav[aria-pressed="true"] {
  opacity: 1;
  transform: scale(1);
}

.pg-card__fav:hover {
  color: var(--pg-accent);
  transform: scale(1.1);
}

.pg-card__fav[aria-pressed="true"] {
  background: var(--pg-accent);
  color: var(--pg-white);
}

.pg-card__fav.is-animating {
  animation: heartPop 300ms ease;
}

@keyframes heartPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Compatibilidad con pg-favbtn */
.pg-favbtn{
  position:absolute; top:8px; right:8px;
  width:36px;height:36px;border-radius:999px;border:0;cursor:pointer;
  background:rgba(255,255,255,.9);
  box-shadow:0 4px 14px rgba(0,0,0,.12);
  display:grid;place-items:center;font-size:18px;line-height:1;
}
.pg-favbtn[aria-pressed="true"]{ background:#ff3b30; color:#fff }

/* Info Overlay */
.pg-card__info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--pg-transition);
  pointer-events: none;
}

.pg-card:hover .pg-card__info {
  opacity: 1;
}

.pg-card__name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--pg-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pg-card__meta {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LOADER & EMPTY STATES
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--pg-gray-500);
}

.pg-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--pg-gray-200);
  border-top-color: var(--pg-primary);
  border-radius: var(--pg-radius-full);
  animation: spin 0.8s linear infinite;
}

.pg-spinner--light {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: var(--pg-white);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pg-empty,
.pg-empty-project {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: var(--pg-gray-500);
}

.pg-empty svg,
.pg-empty-project svg {
  margin-bottom: 20px;
  color: var(--pg-gray-300);
}

.pg-empty-project h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--pg-gray-700);
}

.pg-empty-project p {
  margin: 0;
  font-size: 15px;
  max-width: 400px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.pg-lightbox.is-open {
  display: flex;
}

.pg-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.pg-lightbox__container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 60px 20px 80px;
}

.pg-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--pg-radius-full);
  color: var(--pg-white);
  cursor: pointer;
  transition: all var(--pg-transition-fast);
  z-index: 10;
}

.pg-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.pg-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--pg-radius-full);
  color: var(--pg-white);
  cursor: pointer;
  transition: all var(--pg-transition-fast);
  z-index: 10;
}

.pg-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.pg-lightbox__nav--prev { left: 20px; }
.pg-lightbox__nav--next { right: 20px; }

/* Compatibilidad lightbox anterior */
.pg-lightbox__btn{
  position:absolute; top:50%; transform:translateY(-50%);
  background:rgba(255,255,255,.12); color:#fff; border:0; border-radius:999px; width:44px; height:44px; cursor:pointer;
}
.pg-lightbox__btn--prev{left:18px} .pg-lightbox__btn--next{right:18px}

.pg-lightbox__content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(90vw, 1600px);
  max-height: calc(100vh - 160px);
}

.pg-lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: var(--pg-radius-sm);
  transition: opacity var(--pg-transition);
}

.pg-lightbox__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pg-lightbox__footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.pg-lightbox__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pg-lightbox__filename {
  font-size: 14px;
  font-weight: 600;
  color: var(--pg-white);
}

.pg-lightbox__counter {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.pg-lightbox__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pg-lightbox__fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid transparent;
  border-radius: var(--pg-radius-full);
  cursor: pointer;
  color: var(--pg-gray-400);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pg-lightbox__fav:hover {
  color: var(--pg-accent);
  border-color: var(--pg-accent-light);
  transform: scale(1.1);
}

.pg-lightbox__fav:active {
  transform: scale(0.95);
}

.pg-lightbox__fav[aria-pressed="true"] {
  background: var(--pg-accent);
  color: var(--pg-white);
  border-color: var(--pg-accent);
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4);
}

.pg-lightbox__fav[aria-pressed="true"]:hover {
  background: #e11d48;
  border-color: #e11d48;
}

.pg-lightbox__fav.is-animating {
  animation: heartBounce 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pg-lightbox__fav[aria-pressed="true"] svg {
  animation: heartPulse 600ms ease;
}

.pg-lightbox__download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--pg-white);
  border-radius: var(--pg-radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--pg-gray-900);
  text-decoration: none;
  transition: all var(--pg-transition-fast);
}

.pg-lightbox__download:hover {
  background: var(--pg-gray-100);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .pg-lightbox__nav { width: 44px; height: 44px; }
  .pg-lightbox__nav--prev { left: 8px; }
  .pg-lightbox__nav--next { right: 8px; }
  .pg-lightbox__container { padding: 50px 8px 70px; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   LEGACY FILES VIEW
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-legacy .pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--pg-gap-lg);
}

.pg-legacy .app-card {
  border-radius: var(--pg-radius);
  overflow: hidden;
  border: 1px solid var(--pg-gray-200);
  background: var(--pg-white);
  transition: all var(--pg-transition);
}

.pg-legacy .app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pg-shadow-lg);
}

/* ══════════════════════════════════════════════════════════════════════════════
   ADMIN UPLOADER STYLES
   ══════════════════════════════════════════════════════════════════════════════ */
.uploader {
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius);
  padding: 20px;
  background: var(--pg-white);
  margin-bottom: 24px;
}

.uploader__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.uploader__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--pg-gray-900);
}

.uploader__bar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
}

.uploader__bar label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--pg-gray-600);
  margin-bottom: 6px;
}

.uploader__bar select,
.uploader__bar input[type="file"] {
  padding: 10px 14px;
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius-sm);
  font-size: 14px;
  background: var(--pg-white);
}

.uploader__drop {
  margin-top: 16px;
  border: 2px dashed var(--pg-gray-300);
  border-radius: var(--pg-radius);
  padding: 32px;
  text-align: center;
  color: var(--pg-gray-500);
  background: var(--pg-gray-50);
  cursor: pointer;
  transition: all var(--pg-transition-fast);
}

.uploader__drop:hover,
.uploader__drop.is-over {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4f46e5;
}

.uploader__overall {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.uploader__overall-bar {
  flex: 1;
  height: 8px;
  background: var(--pg-gray-200);
  border-radius: var(--pg-radius-full);
  overflow: hidden;
}

.uploader__overall-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  transition: width var(--pg-transition);
}

.uploader__overall-text {
  font-weight: 700;
  color: var(--pg-gray-700);
  min-width: 40px;
}

.uploader__counter {
  font-size: 13px;
  color: var(--pg-gray-500);
}

/* Uploader List - Scrollable */
.uploader__list {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--pg-gray-100);
  border-radius: var(--pg-radius-sm);
  padding: 8px;
}

.uploader__item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius-sm);
  background: var(--pg-white);
  margin-bottom: 8px;
  position: relative;
}

.uploader__item:last-child {
  margin-bottom: 0;
}

.uploader-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--pg-radius-sm);
  object-fit: cover;
  background: var(--pg-gray-100);
  flex-shrink: 0;
}

.uploader-body {
  flex: 1;
  min-width: 0;
}

.uploader-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--pg-gray-800);
}

.uploader-meta {
  font-size: 12px;
  color: var(--pg-gray-500);
  margin-top: 2px;
}

.uploader-bar {
  height: 6px;
  background: var(--pg-gray-200);
  border-radius: var(--pg-radius-full);
  overflow: hidden;
  margin-top: 8px;
}

.uploader-bar__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  transition: width var(--pg-transition-fast);
}

.uploader-state {
  font-size: 12px;
  color: var(--pg-gray-500);
  margin-top: 4px;
}

.uploader-remove {
  position: absolute;
  right: 8px;
  top: 8px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--pg-gray-400);
  transition: color var(--pg-transition-fast);
}

.uploader-remove:hover {
  color: var(--pg-accent);
}

.uploader__item.is-uploading {
  border-color: #60a5fa;
  background: #eff6ff;
}

.uploader__item.is-done {
  border-color: #34d399;
  background: #ecfdf5;
}

.uploader__item.is-error {
  border-color: #f87171;
  background: #fef2f2;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ADMIN FILES GALLERY (Collapsible)
   ══════════════════════════════════════════════════════════════════════════════ */
.admin-files {
  margin-top: 24px;
}

.admin-files__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--pg-gray-50);
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius) var(--pg-radius) 0 0;
  cursor: pointer;
  user-select: none;
}

.admin-files__header:hover {
  background: var(--pg-gray-100);
}

.admin-files__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--pg-gray-800);
}

.admin-files__count {
  font-size: 13px;
  font-weight: 500;
  color: var(--pg-gray-500);
  padding: 4px 10px;
  background: var(--pg-white);
  border-radius: var(--pg-radius-full);
  border: 1px solid var(--pg-gray-200);
}

.admin-files__toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pg-white);
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius-sm);
  transition: transform var(--pg-transition-fast);
}

.admin-files.is-collapsed .admin-files__toggle {
  transform: rotate(-90deg);
}

.admin-files__content {
  border: 1px solid var(--pg-gray-200);
  border-top: none;
  border-radius: 0 0 var(--pg-radius) var(--pg-radius);
  padding: 16px;
  max-height: 500px;
  overflow-y: auto;
}

.admin-files.is-collapsed .admin-files__content {
  display: none;
}

.admin-files__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.admin-file {
  position: relative;
  border-radius: var(--pg-radius-sm);
  overflow: hidden;
  background: var(--pg-gray-100);
  aspect-ratio: 1;
}

.admin-file__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-file__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--pg-transition-fast);
}

.admin-file:hover .admin-file__overlay {
  opacity: 1;
}

.admin-file__btn {
  padding: 8px 12px;
  background: var(--pg-white);
  border: none;
  border-radius: var(--pg-radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--pg-gray-800);
  cursor: pointer;
  text-decoration: none;
}

.admin-file__btn--delete {
  background: var(--pg-accent);
  color: var(--pg-white);
}

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE TOOLBAR
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .pg-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }

  .pg-toolbar__left,
  .pg-toolbar__right {
    width: 100%;
  }

  .pg-toolbar__right {
    justify-content: space-between;
  }

  .pg-actions {
    flex: 1;
  }

  .pg-sort {
    flex-shrink: 0;
  }

  .pg-sort select {
    padding: 8px 32px 8px 12px;
    font-size: 13px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   LEGACY GALLERY STYLES (Videos, Documentos)
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-subtitle {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--pg-gray-800);
  margin: 32px 0 16px;
}

.pg-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--pg-gap-lg);
}

.pg-video {
  border-radius: var(--pg-radius);
  overflow: hidden;
  background: var(--pg-gray-900);
}

.pg-video video {
  width: 100%;
  display: block;
}

.pg-video .pg-caption {
  padding: 12px 16px;
  background: var(--pg-gray-800);
  color: var(--pg-white);
}

.pg-video .pg-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

.pg-video .pg-meta {
  display: block;
  font-size: 12px;
  color: var(--pg-gray-400);
  margin-top: 4px;
}

.pg-mini-btn {
  display: inline-block;
  margin: 0 16px 12px;
  padding: 8px 16px;
  background: var(--pg-white);
  border-radius: var(--pg-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--pg-gray-800);
  text-decoration: none;
  transition: all var(--pg-transition-fast);
}

.pg-mini-btn:hover {
  background: var(--pg-gray-100);
}

.pg-others {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pg-other {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--pg-gray-50);
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius);
}

.pg-fileicon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--pg-white);
  border-radius: var(--pg-radius-sm);
  border: 1px solid var(--pg-gray-200);
}

.pg-other .pg-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--pg-gray-800);
}

.pg-other .pg-meta {
  font-size: 13px;
  color: var(--pg-gray-500);
  margin-top: 2px;
}

.pg-other .pg-mini-btn {
  margin: 0;
  margin-left: auto;
}

/* ══════════════════════════════════════════════════════════════════════════════
   SENTINEL FOR INFINITE SCROLL
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-sentinel {
  height: 1px;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FAVORITES TAB - Special styling
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-tab--fav {
  display: inline-flex;
  align-items: center;
}

.pg-tab--fav svg {
  flex-shrink: 0;
  transition: all var(--pg-transition-fast);
}

.pg-tab--fav:not(.is-active) svg {
  color: var(--pg-gray-400);
}

.pg-tab--fav:hover:not(.is-active) svg {
  color: var(--pg-accent);
}

.pg-tab--fav.is-active {
  background: var(--pg-accent);
  border-color: var(--pg-accent);
  color: var(--pg-white);
}

.pg-tab--fav.is-active svg {
  color: var(--pg-white);
}

/* ══════════════════════════════════════════════════════════════════════════════
   IMPROVED FAVORITE BUTTON
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-card__fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid transparent;
  border-radius: var(--pg-radius-full);
  cursor: pointer;
  color: var(--pg-gray-400);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: scale(0.85);
  transition: all 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.pg-card:hover .pg-card__fav,
.pg-card__fav[aria-pressed="true"] {
  opacity: 1;
  transform: scale(1);
}

.pg-card__fav:hover {
  color: var(--pg-accent);
  border-color: var(--pg-accent-light);
  transform: scale(1.1);
}

.pg-card__fav:active {
  transform: scale(0.95);
}

.pg-card__fav[aria-pressed="true"] {
  background: var(--pg-accent);
  color: var(--pg-white);
  border-color: var(--pg-accent);
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4);
}

.pg-card__fav[aria-pressed="true"]:hover {
  background: #e11d48;
  border-color: #e11d48;
}

/* Heart animation */
.pg-card__fav.is-animating {
  animation: heartBounce 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heartBounce {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.25); }
  50%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Heart pulse when favorited */
.pg-card__fav[aria-pressed="true"] svg {
  animation: heartPulse 600ms ease;
}

@keyframes heartPulse {
  0%   { transform: scale(1); }
  15%  { transform: scale(1.3); }
  30%  { transform: scale(0.9); }
  45%  { transform: scale(1.15); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   EMPTY STATE FOR FAVORITES
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-empty--favorites {
  padding: 80px 24px;
}

.pg-empty--favorites svg {
  color: var(--pg-accent-light);
  opacity: 0.6;
}

.pg-empty--favorites h3 {
  margin: 16px 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--pg-gray-700);
}

.pg-empty--favorites p {
  margin: 0;
  font-size: 15px;
  color: var(--pg-gray-500);
  max-width: 360px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS (for feedback)
   ══════════════════════════════════════════════════════════════════════════════ */
.pg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 24px;
  background: var(--pg-gray-900);
  color: var(--pg-white);
  border-radius: var(--pg-radius);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pg-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pg-toast--success {
  background: #059669;
}

.pg-toast--fav {
  background: var(--pg-accent);
}

/* ══════════════════════════════════════════════════════════════════════════════
   MOBILE TOUCH OPTIMIZATIONS FOR GALLERY
   Critical fixes for mobile photo gallery interactivity
   ══════════════════════════════════════════════════════════════════════════════ */

/* Remove tap highlight on all interactive elements */
.pg-card,
.pg-card__link,
.pg-card__fav,
.pg-tab,
.pg-action-btn,
.pg-lightbox__close,
.pg-lightbox__nav {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* Improve touch action for gallery elements */
.pg-card__link {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.pg-card__img {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* Better touch targets on mobile */
@media (max-width: 768px) {
  /* Hero section adjustments */
  .pg-hero__badge {
    min-height: 32px;
    padding: 8px 16px;
  }

  /* Toolbar improvements */
  .pg-toolbar {
    position: relative; /* Not sticky on mobile for better scrolling */
    top: auto;
    margin-bottom: 16px;
  }

  /* Tab improvements */
  .pg-tab {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 15px;
    touch-action: manipulation;
  }

  /* Action buttons - bigger touch targets */
  .pg-action-btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 16px;
  }

  .pg-action-text {
    display: none; /* Hide text on very small screens */
  }

  /* Sort dropdown */
  .pg-sort select {
    min-height: 44px;
    padding: 12px 40px 12px 16px;
    font-size: 16px; /* Prevents iOS zoom */
  }

  /* Grid spacing adjustments */
  .pg-grid {
    gap: 8px;
  }

  /* Card improvements */
  .pg-card {
    border-radius: 8px;
  }

  /* Favorite button - always visible and bigger on mobile */
  .pg-card__fav {
    min-width: 48px;
    min-height: 48px;
    width: 48px;
    height: 48px;
    top: 8px;
    right: 8px;
    opacity: 1 !important;
    transform: scale(1) !important;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .pg-card__fav svg {
    width: 24px;
    height: 24px;
  }

  /* Card info - better sizing */
  .pg-card__info {
    padding: 24px 12px 12px;
    opacity: 1; /* Always visible on mobile */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  }

  .pg-card__name {
    font-size: 14px;
  }

  .pg-card__meta {
    font-size: 12px;
  }

  /* Lightbox improvements */
  .pg-lightbox__container {
    padding: 60px 12px 100px;
  }

  .pg-lightbox__close {
    width: 56px;
    height: 56px;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
  }

  .pg-lightbox__close svg {
    width: 28px;
    height: 28px;
  }

  .pg-lightbox__nav {
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
  }

  .pg-lightbox__nav svg {
    width: 36px;
    height: 36px;
  }

  .pg-lightbox__nav--prev {
    left: 8px;
  }

  .pg-lightbox__nav--next {
    right: 8px;
  }

  .pg-lightbox__footer {
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .pg-lightbox__fav {
    width: 56px;
    height: 56px;
  }

  .pg-lightbox__fav svg {
    width: 24px;
    height: 24px;
  }

  .pg-lightbox__download {
    min-height: 48px;
    padding: 14px 24px;
    font-size: 15px;
  }

  /* Prevent image interaction in lightbox */
  .pg-lightbox__img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
    touch-action: none;
  }

  /* Content area adjustments */
  .pg-lightbox__content {
    max-width: 95vw;
    max-height: calc(100vh - 200px);
  }
}

/* Extra small screens */
@media (max-width: 500px) {
  /* Single column grid */
  .pg-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Toolbar full width */
  .pg-toolbar__left,
  .pg-toolbar__right {
    width: 100%;
  }

  .pg-actions {
    gap: 8px;
  }

  /* Hide action text on small screens */
  .pg-action-text {
    display: none;
  }

  /* Bigger buttons for small screens */
  .pg-action-btn {
    min-width: 52px;
  }

  /* Hero adjustments */
  .pg-hero__content {
    padding: 20px 16px;
  }

  .pg-hero__title {
    font-size: 24px;
  }

  .pg-hero__description {
    font-size: 14px;
  }
}

/* Landscape mobile phones */
@media (max-width: 896px) and (orientation: landscape) {
  .pg-hero__cover {
    height: 240px;
  }

  .pg-lightbox__container {
    padding: 40px 12px 60px;
  }

  .pg-lightbox__content {
    max-height: calc(100vh - 120px);
  }
}

/* Prevent double-tap zoom on gallery elements */
.pg-card,
.pg-card__link,
.pg-tab,
.pg-action-btn {
  touch-action: manipulation;
}

/* Improve scrolling performance */
.pg-grid {
  -webkit-overflow-scrolling: touch;
}

.pg-toolbar {
  -webkit-overflow-scrolling: touch;
}

/* Safe area support for modern phones */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .pg-toolbar {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
    }

    .pg-container {
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
    }

    .pg-lightbox__footer {
      padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PREVENT HORIZONTAL SCROLL ON MOBILE
   Critical fix to prevent overflow and horizontal scrolling
   ══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Prevent horizontal scroll globally */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Ensure all sections fit within viewport */
  .pg-section,
  .pg-hero,
  .pg-container,
  .pictorial-content {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Prevent toolbar from overflowing */
  .pg-toolbar {
    max-width: calc(100vw - 24px); /* Account for container padding */
  }

  /* Ensure grid doesn't overflow */
  .pg-grid {
    max-width: 100%;
  }

  /* Prevent long text from causing overflow */
  .pg-hero__title,
  .pg-hero__description,
  .pg-card__name {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* Make sure images don't overflow */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Extra precaution for very small screens */
@media (max-width: 500px) {
  /* Tighter constraints for small screens */
  .pg-toolbar {
    max-width: calc(100vw - 16px);
  }

  .pg-container {
    max-width: 100vw;
  }

  /* Ensure flex items don't force overflow */
  .pg-toolbar__left,
  .pg-toolbar__right,
  .pg-actions,
  .pg-tabs {
    max-width: 100%;
  }

  /* Make action buttons stack better */
  .pg-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Ensure select doesn't overflow */
  .pg-sort select {
    max-width: 100%;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   ADMIN INTERFACE COMPONENTS
   Estilos para el panel de administración
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Admin Buttons ───────────────────────────────────────────────────────── */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--pg-radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--pg-transition-fast);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.admin-btn--primary {
  background: var(--pg-primary);
  color: var(--pg-white);
  border-color: var(--pg-primary);
}

.admin-btn--primary:hover {
  background: var(--pg-primary-hover);
  color: var(--pg-white);
  border-color: var(--pg-primary-hover);
}

.admin-btn--secondary {
  background: var(--pg-white);
  color: var(--pg-gray-700);
  border-color: var(--pg-gray-300);
}

.admin-btn--secondary:hover {
  background: var(--pg-gray-50);
  color: var(--pg-gray-900);
  border-color: var(--pg-gray-400);
}

.admin-btn--warning {
  background: #f59e0b;
  color: var(--pg-white);
  border-color: #f59e0b;
}

.admin-btn--warning:hover {
  background: #d97706;
  color: var(--pg-white);
  border-color: #d97706;
}

.admin-btn--info {
  background: #3b82f6;
  color: var(--pg-white);
  border-color: #3b82f6;
}

.admin-btn--info:hover {
  background: #2563eb;
  color: var(--pg-white);
  border-color: #2563eb;
}

.admin-btn--danger {
  background: var(--pg-accent);
  color: var(--pg-white);
  border-color: var(--pg-accent);
}

.admin-btn--danger:hover {
  background: #e11d48;
  color: var(--pg-white);
  border-color: #e11d48;
}

.admin-btn--success-outline {
  background: var(--pg-white);
  color: #059669;
  border-color: #10b981;
}

.admin-btn--success-outline.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-btn--lg {
  padding: 14px 24px;
  font-size: 16px;
}

/* ── Admin Actions Bar ───────────────────────────────────────────────────── */
.admin-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--pg-white);
  border: 1px solid var(--pg-gray-200);
  border-radius: var(--pg-radius);
  flex-wrap: wrap;
}

.admin-actions-bar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.admin-actions-bar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-left: 16px;
  border-left: 1px solid var(--pg-gray-200);
}

/* Visual separator for button groups */
.admin-actions-bar__left > .admin-btn:first-child {
  margin-right: 6px;
}

.admin-actions-bar__left > .admin-btn--warning {
  margin-right: 6px;
}

/* Responsive adjustments for admin bar */
@media (max-width: 768px) {
  .admin-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .admin-actions-bar__left,
  .admin-actions-bar__right {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-actions-bar__left {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-actions-bar__right {
    padding-left: 0;
    border-left: none;
    padding-top: 8px;
    border-top: 1px solid var(--pg-gray-200);
  }

  .admin-btn {
    justify-content: center;
    width: 100%;
  }

  /* Remove visual separators on mobile */
  .admin-actions-bar__left > .admin-btn:first-child,
  .admin-actions-bar__left > .admin-btn--warning {
    margin-right: 0;
  }
}

@media (max-width: 500px) {
  .admin-actions-bar {
    padding: 12px;
  }

  .admin-btn {
    padding: 12px 16px;
    font-size: 13px;
  }

  .admin-btn svg {
    width: 16px;
    height: 16px;
  }
}
