/* ============================================================
   OrganiProyect Web — Tema Brisa Ártica (Estilo Nativo OrganiProyect)
   Inspirado fielmente en Style.qss de la versión de escritorio
   ============================================================ */

:root {
  --primary: #007ACC;
  --primary-hover: #005D9E;
  --primary-pressed: #005187;
  --primary-light: #E0F2FE;
  
  --bg-app: #F3F4F6;        /* Gris claro gélido de OrganiProyect */
  --bg-sidebar: #E5E7EB;    /* Plata suave del menú lateral */
  --bg-card: #FFFFFF;       /* Blanco puro para tarjetas y diálogos */
  --bg-hover: #F8FAFC;
  
  --text-main: #1F2937;     /* Gris carbón oscuro */
  --text-muted: #6B7280;    /* Gris pizarra medio */
  --text-sub: #4B5563;
  
  --border: #D1D5DB;        /* Bordes sutiles */
  --border-light: #E5E7EB;
  
  --badge-raw: #7C3AED;
  --badge-video: #0284C7;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 4px 12px 0 rgba(0, 122, 204, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Solo permitir selección de texto en campos de entrada y texto explícitamente copiable */
input,
textarea,
[contenteditable="true"],
.selectable-text,
.exif-table td {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Prevenir arrastre de imágenes, iconos y videos */
img,
svg,
video {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Estilo sutil y corporativo para selecciones permitidas (inputs) */
::selection {
  background-color: rgba(0, 122, 204, 0.25);
  color: inherit;
}

::-moz-selection {
  background-color: rgba(0, 122, 204, 0.25);
  color: inherit;
}

/* Reforzar la prevención de selección en componentes interactivos */
.main-content,
.sidebar,
.toolbar,
.toolbar-title,
.toolbar-count,
.filter-button-group,
.filter-btn,
.breadcrumbs-container,
.breadcrumbs-nav,
.breadcrumb-item,
.crumb-back-slot,
.btn-crumb-back,
.gallery-grid,
.folder-card,
.folder-card *,
.photo-card,
.photo-card *,
.sidebar-footer-card,
.sidebar-footer-card *,
.nav-item,
.folder-nav-item,
.live-status-pill,
.btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ── HEADER SUPERIOR ORGANIPROYECT ────────────────────────── */
header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Botón de Menú Móvil / Drawer */
.btn-toggle-sidebar {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-toggle-sidebar:hover {
  background: #F3F4F6;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-toggle-sidebar svg {
  width: 20px;
  height: 20px;
}

/* Encabezado Móvil dentro de la barra lateral */
.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px 6px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
}

.sidebar-mobile-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.sidebar-mobile-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.btn-close-sidebar {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-sidebar:hover {
  background: #E5E7EB;
  color: #111827;
}

.btn-close-sidebar svg {
  width: 18px;
  height: 18px;
}

/* Telón de fondo (Backdrop) para Drawer en móviles y tablets */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  user-select: none;
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 122, 204, 0.22));
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-logo-gob {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.16));
}

.brand:hover .brand-logo-img {
  transform: scale(1.05);
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.brand-name-gob {
  font-size: 16.5px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.25px;
}

.brand-name-arc {
  color: #007ACC;
}

.brand-name-sync {
  color: #1F2937;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* Barra de Búsqueda Ejecutiva */
.search-container {
  flex-grow: 1;
  max-width: 600px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px 6px 14px;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.14);
}

.search-icon {
  color: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
}

.search-input::placeholder {
  color: #9CA3AF;
}

.search-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: #F1F5F9;
  color: #64748B;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.search-clear-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.search-clear-btn:active {
  transform: scale(0.92);
}

/* Botones de Cabecera */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Indicador dinámico de conectividad (Conectado / Sincronizando / Modo local / Sin red) */
.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: #166534;
  user-select: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.live-status-pill.syncing {
  background: #F0F9FF;
  border-color: #BAE6FD;
  color: #0369A1;
}

.live-status-pill.local-only {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.live-status-pill.offline {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16A34A;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
  animation: pulse-live 2.4s infinite;
}

.live-status-pill.syncing .live-dot {
  background: #0284C7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
  animation: pulse-sync 1.2s infinite;
}

.live-status-pill.local-only .live-dot {
  background: #D97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
  animation: none;
}

.live-status-pill.offline .live-dot {
  background: #EF4444;
  box-shadow: none;
  animation: none;
}

@keyframes pulse-live {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

@keyframes pulse-sync {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.6); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(2, 132, 199, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #FFFFFF;
  border: 1px solid var(--primary-hover);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

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

.btn:active {
  background: var(--primary-pressed);
}

.btn-secondary {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text-sub);
}

.btn-secondary:hover {
  background: #F3F4F6;
  border-color: var(--primary);
  color: var(--primary);
}

/* ── LAYOUT PRINCIPAL ───────────────────────────────────────── */
.app-container {
  display: flex;
  flex: 1;
}

/* ── SIDEBAR (Menú Lateral Estilo Plata Suave) ──────────────── */
.sidebar {
  width: 265px;
  min-width: 265px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  padding-left: 6px;
}

.sidebar-folders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-right: 4px;
}

.btn-tree-collapse-all {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-tree-collapse-all:hover {
  background: #D1D5DB;
  color: var(--text-main);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover {
  background: #F3F4F6;
  color: var(--text-main);
}

.nav-item.active {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.nav-badge {
  background: #E5E7EB;
  color: #4B5563;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 6px;
}

.nav-item.active .nav-badge {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── ÁRBOL JERÁRQUICO DE CARPETAS (EXPANDIBLE / COLAPSABLE) ── */
.folder-tree-node {
  display: flex;
  flex-direction: column;
  margin-bottom: 1px;
}

.folder-nav-item {
  position: relative;
}

.folder-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin-right: 2px;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.folder-tree-toggle:hover {
  background: #D1D5DB;
  color: var(--text-main);
}

.folder-tree-toggle svg,
.folder-tree-toggle i {
  width: 13px;
  height: 13px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rotación elegante del chevron al desplegar */
.folder-tree-node.is-expanded > .folder-nav-item .folder-tree-toggle svg,
.folder-tree-node.is-expanded > .folder-nav-item .folder-tree-toggle i {
  transform: rotate(90deg);
}

/* Alternancia entre icono de carpeta cerrada y abierta */
.folder-tree-node .folder-icon-open {
  display: none !important;
}

.folder-tree-node.is-expanded > .folder-nav-item .folder-icon-closed {
  display: none !important;
}

.folder-tree-node.is-expanded > .folder-nav-item .folder-icon-open {
  display: inline-flex !important;
}

.folder-tree-indent-spacer {
  width: 18px;
  height: 18px;
  margin-right: 2px;
  flex-shrink: 0;
  display: inline-block;
}

.folder-nav-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-children-container {
  display: none;
  position: relative;
}

.folder-tree-node.is-expanded > .folder-children-container {
  display: block;
}

/* Línea de guía visual izquierda estilo árbol limpio */
.folder-children-container::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 2px;
  bottom: 4px;
  width: 1px;
  background: rgba(209, 213, 219, 0.7);
  pointer-events: none;
}

.folders-empty-state {
  padding: 12px 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Tarjeta de estado de almacenamiento en sidebar */
.sidebar-footer-card {
  margin-top: auto;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-dev-footer {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #9CA3AF;
  text-align: center;
  letter-spacing: normal;
  line-height: 1.2;
  margin-top: -4px;
  margin-bottom: 6px;
  padding: 0;
  user-select: none;
}

/* ── ÁREA DE CONTENIDO Y GALERÍA ───────────────────────────── */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
  overflow-y: auto;
}

.toolbar {
  padding: 16px 24px 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbar-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.toolbar-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.toolbar-count {
  font-size: 12px;
  color: var(--text-muted);
}

.filter-button-group {
  display: flex;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  background: #F3F4F6;
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: #FFFFFF;
}

/* ── BARRA DE MIGAS DE PAN (BREADCRUMBS) ─────────────────── */
.breadcrumbs-container {
  padding: 4px 24px 12px 24px;
}

.breadcrumbs-nav {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  box-shadow: var(--shadow-sm);
  min-height: 44px;
}

/* Contenedor fijo para que Inicio permanezca en su posición exacta sin moverse */
.crumb-back-slot {
  width: 34px;
  min-width: 34px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-right: 8px;
  border-right: 1px solid var(--border-light);
  padding-right: 6px;
  position: relative;
}

.btn-crumb-back {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.85) translateX(-4px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.25s ease,
              background-color 0.15s ease,
              border-color 0.15s ease,
              color 0.15s ease;
}

.btn-crumb-back.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1) translateX(0);
}

.btn-crumb-back:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  border-color: var(--primary);
}

.btn-crumb-back:active {
  transform: scale(0.92);
}

.breadcrumbs-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  flex-grow: 1;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.breadcrumb-item:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
}

.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 700;
  cursor: default;
}

.breadcrumb-item.active:hover {
  background: transparent;
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-size: 12px;
  user-select: none;
  display: flex;
  align-items: center;
}

.breadcrumb-search-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  padding: 2px 6px 2px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.crumb-scope-action {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.crumb-scope-action:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.crumb-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #64748B;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.crumb-clear-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.empty-state-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  background: #FFFFFF;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

/* ── CUADRÍCULA DE FOTOGRAFÍAS Y CARPETAS ──────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 12px 24px 40px 24px;
}

/* ── TARJETA DE CARPETA (FOLDER CARD / MARCADOR) ────────── */
.folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.folder-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.folder-card-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #F0F4F8 0%, #E2E8F0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.folder-card-icon-container {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.folder-card:hover .folder-card-icon-container {
  transform: scale(1.06);
}

.folder-card-icon {
  width: 38px;
  height: 38px;
  color: var(--primary);
}

.folder-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.78);
  color: #FFFFFF;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 4px;
}

.folder-card-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #FFFFFF;
  border-top: 1px solid var(--border-light);
}

.folder-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-card-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.photo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.photo-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.photo-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #E2E8F0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-thumb-wrapper:has(.badge-format.video) {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}

.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.28s ease-out, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-thumb.is-loaded {
  opacity: 1;
}

.photo-card:hover .photo-thumb.is-loaded {
  transform: scale(1.02);
}

/* Insignia de Formato (.RAW, .JPG, .CR3) */
.badge-format {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  letter-spacing: 0.5px;
}

.badge-format.raw {
  background: var(--badge-raw);
  color: #FFFFFF;
}

.badge-format.video {
  background: var(--badge-video);
  color: #FFFFFF;
}

/* Indicador central de reproducción para videos en la galería */
.badge-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
}

.photo-card:hover .badge-video-play {
  transform: translate(-50%, -50%) scale(1.12);
  background: var(--primary);
}

/* Insignia en tarjeta si aparece Luis Caldera */
.badge-gov-chip {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 2;
}

.badge-gov-chip svg {
  width: 11px;
  height: 11px;
  color: #818CF8;
}

/* Botón Favorito */
.badge-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.badge-fav:hover {
  transform: scale(1.1);
  color: #EF4444;
}

.badge-fav.active {
  color: #EF4444;
}

/* Cuerpo de la Tarjeta */
.photo-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #FFFFFF;
}

.photo-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── VISOR LIGHTBOX EJECUTIVO ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 1100px;
  max-height: 88vh;
  display: flex;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.lightbox-preview {
  flex: 2;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.lightbox-video {
  width: 100%;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-sm);
  background: #000000;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  outline: none;
}

.lightbox-sidebar {
  width: 320px;
  flex-shrink: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  background: #F8FAFC;
  border-left: 1px solid var(--border);
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.lightbox-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  word-break: break-all;
}

.lightbox-folder {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 2px;
}

.lightbox-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.lightbox-close:hover {
  color: #111827;
}

/* Tabla de Metadatos */
.section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.exif-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.exif-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}

.exif-table td:first-child {
  color: var(--text-muted);
  font-weight: 500;
  width: 40%;
}

.exif-table td:last-child {
  color: #111827;
  font-weight: 600;
}

.description-box {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #374151;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  background: #E5E7EB;
  color: #374151;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.tag-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.person-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  color: #3730A3;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.person-tag-pill svg {
  width: 14px;
  height: 14px;
}

/* ── MENÚ CONTEXTUAL (CLIC DERECHO ESTILO ORGANIPROYECT) ──── */
.context-menu {
  position: fixed;
  z-index: 2000;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
  min-width: 240px;
  padding: 5px 0;
  display: flex;
  flex-direction: column;
  user-select: none;
  animation: contextMenuFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.context-menu-item i,
.context-menu-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-sub);
  flex-shrink: 0;
  stroke-width: 1.8;
}

.context-menu-item:hover {
  background: #F3F4F6;
  color: var(--primary);
}

.context-menu-item:hover i,
.context-menu-item:hover svg {
  color: var(--primary);
}

.context-menu-separator {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* ── NOTIFICACIONES TOAST (Brisa Ártica) ──────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
  animation: toastSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 340px;
}

.toast.success {
  border-left-color: #10B981;
}

.toast.error {
  border-left-color: var(--danger);
}

.toast svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.toast.success svg {
  color: #10B981;
}

.toast.error svg {
  color: var(--danger);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── ESTILOS DEL PANEL DE INDEXACIÓN VISUAL E INTELIGENCIA DE CATÁLOGO ── */
.btn-ai-recon {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-ai-recon:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0284C7;
  transform: translateY(-1px);
}

.ai-unindexed-pill {
  background: #0284C7;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

/* ── MODAL DE INDEXACIÓN POR LOTES (ESTRUCTURA EJECUTIVA SIN CORTES) ── */
.ai-modal-container {
  max-width: 580px !important;
  width: 95% !important;
  max-height: min(92vh, 860px) !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  background: #FFFFFF;
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light, #E2E8F0);
  background: #FFFFFF;
  flex-shrink: 0;
}

.ai-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.ai-modal-body {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.ai-modal-body::-webkit-scrollbar {
  width: 6px;
}

.ai-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.ai-modal-body::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.ai-modal-body::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Métricas en el modal */
.ai-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ai-metric-card {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-metric-card.highlight {
  background: #F0F9FF;
  border-color: #BAE6FD;
}

.ai-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.ai-metric-value {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  font-variant-numeric: tabular-nums;
}

.ai-metric-card.highlight .ai-metric-value {
  color: #0284C7;
}

/* Telemetría de Reutilización de API y Tokens */
.ai-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ai-telemetry-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 7px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.ai-telemetry-label {
  font-size: 11px;
  color: #64748B;
  font-weight: 600;
}

.ai-telemetry-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #0F172A;
  font-variant-numeric: tabular-nums;
}

/* Panel de Configuración y Calculadora de Capacidad */
.ai-config-panel {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-config-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 540px) {
  .ai-telemetry-grid,
  .ai-config-two-cols {
    grid-template-columns: 1fr;
  }
}

.ai-calculator-box {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #0F172A;
}

.ai-calc-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #DCFCE7;
  color: #166534;
}

.ai-calc-badge.warn {
  background: #FEF3C7;
  color: #92400E;
}

.ai-calc-summary {
  font-size: 11.5px;
  color: #334155;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.ai-calc-benchmarks {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 5px;
  border-top: 1px dashed #CBD5E1;
  font-size: 10.5px;
  color: #64748B;
  font-variant-numeric: tabular-nums;
}

.ai-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}

.ai-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  font-size: 12.5px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s;
}

.ai-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.ai-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0F172A;
  cursor: pointer;
}

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

/* Tarjeta de Contador de Reinicio de Cuota Google */
.quota-countdown-card {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #F59E0B;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

.quota-countdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quota-countdown-icon {
  width: 24px;
  height: 24px;
  color: #D97706;
  flex-shrink: 0;
}

.quota-countdown-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400E;
}

.quota-countdown-sub {
  font-size: 11.5px;
  color: #B45309;
  margin-top: 2px;
}

.quota-countdown-timer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  padding: 10px 14px;
}

.quota-countdown-digits {
  font-size: 22px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #B45309;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.quota-countdown-target {
  font-size: 12px;
  font-weight: 600;
  color: #78350F;
}

/* Tarjeta de Progreso Dinámico */
.ai-live-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.ai-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.ai-live-batch {
  color: #0F172A;
}

.ai-live-pct {
  background: #F0F9FF;
  color: #0284C7;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ai-progress-track {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.ai-progress-track.mini {
  height: 6px;
  margin: 6px 0;
}

.ai-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0284C7 0%, #007ACC 100%);
  border-radius: 6px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-live-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.ai-activity-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  font-weight: 500;
}

.ai-activity-ticker {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
}

.ai-time-estimate {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ai-spin-icon {
  width: 14px;
  height: 14px;
  color: #0284C7;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

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

.ai-actions-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 20px 14px 20px;
  border-top: 1px solid var(--border-light, #E2E8F0);
  background: #F8FAFC;
  flex-shrink: 0;
  margin: 0;
}

.btn-warning {
  background: #F59E0B;
  color: #FFFFFF;
  border: none;
}
.btn-warning:hover {
  background: #D97706;
}

.btn-danger {
  background: #EF4444;
  color: #FFFFFF;
  border: none;
}
.btn-danger:hover {
  background: #DC2626;
}

/* Widget Flotante de Progreso mientras navegas */
.ai-floating-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid #CBD5E1;
  border-left: 4px solid #0284C7;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  padding: 12px 16px;
  width: 300px;
  z-index: 999;
  cursor: pointer;
  animation: toastSlideIn 0.3s ease;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-floating-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.18);
}

.ai-floating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.ai-floating-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #0F172A;
}

.ai-floating-title svg {
  width: 14px;
  height: 14px;
  color: #0284C7;
}

.ai-floating-pct {
  color: #0284C7;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ai-floating-ticker {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── BARRA DE PAGINACIÓN NUMÉRICA POR SECCIONES ─────────────── */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px 44px 24px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.pagination-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: #F1F5F9;
}

.pagination-btn.active {
  background: #007ACC !important;
  border-color: #007ACC !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  opacity: 1 !important;
  cursor: default !important;
  box-shadow: 0 2px 8px rgba(0, 122, 204, 0.4) !important;
}

.pagination-btn.active:hover {
  background: #007ACC !important;
  border-color: #007ACC !important;
  color: #FFFFFF !important;
}

.pagination-btn:disabled:not(.active) {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border-light);
  color: var(--text-muted);
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 38px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
}

/* ============================================================
   SISTEMA DE DISEÑO RESPONSIVO AVANZADO (MÓVILES Y TABLETS)
   ============================================================ */

/* ── TABLETS Y DISPOSITIVOS MEDIANOS (<= 850px) ────────────── */
@media (max-width: 850px) {
  /* Botón hamburguesa visible */
  .btn-toggle-sidebar {
    display: inline-flex;
  }

  /* Encabezado del menú móvil en la parte superior del drawer */
  .sidebar-mobile-header {
    display: flex;
  }

  /* Menú Lateral como Drawer Deslizable (Off-canvas) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 295px;
    max-width: 84vw;
    height: 100vh;
    max-height: 100vh;
    z-index: 1200;
    background: #FFFFFF;
    border-right: 1px solid var(--border);
    border-bottom: none;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.22);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 28px 14px;
  }

  /* Drawer abierto */
  .sidebar.open {
    transform: translateX(0);
  }

  /* Telón de fondo activo */
  .sidebar-backdrop {
    display: block;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* El contenido principal ya no es empujado hacia abajo */
  .app-container {
    display: block;
  }

  .main-content {
    width: 100%;
    min-width: 0;
  }

  /* Cuadrícula adaptativa para tablets */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 10px 16px 36px 16px;
  }

  /* Lightbox / Inspector adaptativo para tablets */
  .modal-overlay {
    padding: 12px;
  }

  .modal-content {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
  }

  .lightbox-preview {
    max-height: 44vh;
    min-height: 200px;
    padding: 10px;
    background: #0B0F19;
  }

  .lightbox-img,
  .lightbox-video {
    max-height: 42vh;
  }

  .lightbox-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 14px 18px;
    max-height: 50vh;
    overflow-y: auto;
  }
}

/* ── TABLETS PEQUEÑAS Y TELÉFONOS APAISADOS (<= 768px) ─────── */
@media (max-width: 768px) {
  header {
    padding: 8px 14px;
    gap: 10px;
  }

  .brand-subtitle {
    display: none;
  }

  /* Barra de herramientas y filtros deslizables táctiles */
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px 6px 14px;
  }

  .toolbar-title-group {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-title {
    font-size: 16px;
  }

  .filter-button-group {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    flex-wrap: nowrap;
    border-radius: var(--radius-sm);
    padding: 2px;
  }

  .filter-button-group::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 12px;
  }

  /* Migas de pan deslizables táctiles */
  .breadcrumbs-container {
    padding: 4px 14px 8px 14px;
  }

  .breadcrumbs-nav {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 8px;
    min-height: 40px;
  }

  .breadcrumbs-nav::-webkit-scrollbar {
    display: none;
  }

  .breadcrumbs-bar {
    flex-wrap: nowrap;
  }

  .breadcrumb-item {
    flex-shrink: 0;
    font-size: 12px;
    padding: 3px 6px;
  }
}

/* ── TELÉFONOS MÓVILES EN VERTICAL (<= 600px) ──────────────── */
@media (max-width: 600px) {
  /* Cabecera optimizada en 2 filas */
  header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "nav brand actions"
      "search search search";
    gap: 8px;
    padding: 8px 10px;
  }

  .btn-toggle-sidebar {
    grid-area: nav;
    width: 36px;
    height: 36px;
  }

  .brand {
    grid-area: brand;
    gap: 8px;
  }

  .brand-logo-img {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 17px;
  }

  .header-actions {
    grid-area: actions;
    justify-self: end;
    gap: 6px;
  }

  /* En móviles, ocultar texto de botones de cabecera y mantener iconos con badges */
  .btn > span:not(.ai-unindexed-pill) {
    display: none;
  }

  .btn {
    padding: 7px 10px;
  }

  .btn-ai-recon {
    padding: 7px 10px;
    position: relative;
  }

  .ai-unindexed-pill {
    font-size: 10px;
    padding: 1px 5px;
    min-width: 16px;
    height: 16px;
  }

  .live-status-pill .live-label {
    display: none;
  }

  .live-status-pill {
    padding: 6px 8px;
  }

  /* Barra de búsqueda ocupa el 100% en la 2da fila */
  .search-container {
    grid-area: search;
    max-width: 100%;
    width: 100%;
  }

  .search-input-wrapper {
    padding: 5px 12px;
  }

  .search-input {
    font-size: 13px;
  }

  /* Cuadrícula de fotos estilo nativo en 2 columnas */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px 10px 32px 10px;
  }

  .photo-card {
    border-radius: var(--radius-sm);
  }

  .photo-thumb-wrapper {
    aspect-ratio: 4 / 3;
  }

  .photo-info {
    padding: 8px 8px;
    gap: 2px;
  }

  .photo-name {
    font-size: 11px;
  }

  .photo-meta-bar {
    font-size: 9.5px;
  }

  .badge-gov-chip {
    padding: 2px 6px;
    font-size: 9px;
    bottom: 5px;
    left: 5px;
    gap: 3px;
  }

  .badge-gov-chip svg {
    width: 9px;
    height: 9px;
  }

  .badge-format {
    font-size: 8.5px;
    padding: 1px 4px;
    top: 5px;
    left: 5px;
  }

  .badge-fav {
    width: 26px;
    height: 26px;
    top: 5px;
    right: 5px;
  }

  .badge-fav svg {
    width: 13px;
    height: 13px;
  }

  /* Tarjetas de carpetas en 2 columnas */
  .folder-card {
    border-radius: var(--radius-sm);
  }

  .folder-card-thumb-wrapper {
    aspect-ratio: 4 / 3;
  }

  .folder-card-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .folder-card-icon {
    width: 24px;
    height: 24px;
  }

  .folder-card-info {
    padding: 8px 8px;
  }

  .folder-card-name {
    font-size: 11.5px;
  }

  .folder-card-meta-bar {
    font-size: 9.5px;
  }

  /* Paginación táctil fluida en móviles */
  .pagination-container {
    padding: 12px 6px 36px 6px;
    gap: 8px;
  }

  .pagination-info {
    font-size: 11px;
    text-align: center;
    line-height: 1.4;
  }

  .pagination-controls {
    gap: 4px;
  }

  .pagination-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .pagination-btn-label {
    display: none;
  }

  .pagination-ellipsis {
    min-width: 18px;
    height: 34px;
    font-size: 12px;
  }

  /* Lightbox en smartphones */
  .lightbox-preview {
    max-height: 38vh;
    min-height: 170px;
    padding: 8px;
  }

  .lightbox-img,
  .lightbox-video {
    max-height: 36vh;
  }

  .lightbox-sidebar {
    padding: 12px 14px;
    gap: 10px;
    max-height: 52vh;
  }

  .lightbox-title {
    font-size: 13.5px;
  }

  .exif-table {
    font-size: 11px;
  }

  .exif-table td {
    padding: 3px 0;
  }

  /* Modal de Reconocimiento IA en smartphones */
  .ai-modal-container {
    width: 96% !important;
    max-width: 100% !important;
    max-height: 94vh !important;
    border-radius: var(--radius-md) !important;
  }

  .ai-modal-header {
    padding: 11px 14px;
  }

  .ai-modal-title {
    font-size: 13px;
  }

  .ai-modal-body {
    padding: 11px 14px;
    gap: 8px;
    max-height: calc(94vh - 110px);
  }

  .ai-metrics-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .ai-metric-card {
    padding: 6px 8px;
  }

  .ai-metric-label {
    font-size: 9.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ai-metric-value {
    font-size: 13.5px;
  }

  .quota-countdown-card {
    padding: 8px 10px;
    gap: 6px;
  }

  .quota-countdown-title {
    font-size: 11.5px;
  }

  .quota-countdown-sub {
    font-size: 10px;
  }

  .quota-countdown-timer-row {
    padding: 6px 10px;
  }

  .quota-countdown-digits {
    font-size: 15px;
    letter-spacing: 0.5px;
  }

  .quota-countdown-target {
    font-size: 10.5px;
  }

  .ai-live-card {
    padding: 10px;
    gap: 6px;
  }

  .ai-actions-row {
    padding: 9px 12px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .ai-actions-row .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    padding: 7px 10px;
    font-size: 11.5px;
  }

  /* Widget flotante y Notificaciones toast en móviles */
  .ai-floating-widget {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    padding: 10px 12px;
  }

  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
    align-items: center;
  }

  .toast {
    max-width: 100%;
    width: 100%;
    font-size: 11.5px;
    padding: 8px 12px;
  }
}

/* ── PANTALLAS ULTRA PEQUEÑAS (<= 360px) ────────────────────── */
@media (max-width: 360px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

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

  .ai-metrics-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ── CHIPS DE PALABRAS CRUZADAS EN LA BARRA DE BÚSQUEDA / BREADCRUMBS ── */
.crossword-suggestions-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid #CBD5E1;
  flex-wrap: wrap;
}

.crossword-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  letter-spacing: 0.01em;
}

.crossword-chip {
  appearance: none;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.crossword-chip:hover {
  background: #E0F2FE;
  border-color: #7DD3FC;
  color: #0369A1;
}

